mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 12:18:04 +01:00
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:
@@ -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&);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user