summaryrefslogtreecommitdiff
path: root/src/decoder.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-03-02 09:00:36 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-03-02 09:00:36 +0100
commit5fcef1cac4d9faf0279b83ba48899b0e17b8e2d5 (patch)
treecce0cb9223e29ba38c909cccaac828bc59f7557a /src/decoder.hpp
parent4c7446211a02937f3e2522aece163d417b4ad0b9 (diff)
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 <sustrik@250bpm.com>
Diffstat (limited to 'src/decoder.hpp')
-rw-r--r--src/decoder.hpp5
1 files changed, 4 insertions, 1 deletions
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 <algorithm>
#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&);
};