From 5fcef1cac4d9faf0279b83ba48899b0e17b8e2d5 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 2 Mar 2011 09:00:36 +0100 Subject: ZMQ_MAXMSGSIZE option added The new option allows user to guard against peers sending oversized messages. Connection to peer sending oversized message is dropped. Signed-off-by: Martin Sustrik --- src/decoder.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/decoder.hpp') diff --git a/src/decoder.hpp b/src/decoder.hpp index 6d28801..3b8b460 100644 --- a/src/decoder.hpp +++ b/src/decoder.hpp @@ -26,6 +26,7 @@ #include #include "err.hpp" +#include "stdint.hpp" #include "../include/zmq.h" @@ -180,7 +181,7 @@ namespace zmq { public: - decoder_t (size_t bufsize_); + decoder_t (size_t bufsize_, int64_t maxmsgsize_); ~decoder_t (); void set_inout (struct i_inout *destination_); @@ -196,6 +197,8 @@ namespace zmq unsigned char tmpbuf [8]; ::zmq_msg_t in_progress; + int64_t maxmsgsize; + decoder_t (const decoder_t&); void operator = (const decoder_t&); }; -- cgit v1.2.3