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>
This commit is contained in:
Martin Sustrik
2011-03-02 09:00:36 +01:00
parent 4c7446211a
commit 5fcef1cac4
9 changed files with 72 additions and 7 deletions

View File

@@ -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&);
};