mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 20:59:47 +01:00
Check message syntax in REQ asynchronously
This patch adds support for checking messages as they arrive (as opposed to when they are recv'd by the user) and drop the connection if they are malformed. It also uses this new feature to check for validity of inbound messages in REQ socket. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
@@ -164,10 +164,18 @@ namespace zmq
|
||||
|
||||
private:
|
||||
|
||||
// Where to store the read data.
|
||||
unsigned char *read_pos;
|
||||
|
||||
// How much data to read before taking next step.
|
||||
size_t to_read;
|
||||
|
||||
// Next step. If set to NULL, it means that associated data stream
|
||||
// is dead. Note that there can be still data in the process in such
|
||||
// case.
|
||||
step_t next;
|
||||
|
||||
// The duffer for data to decode.
|
||||
size_t bufsize;
|
||||
unsigned char *buf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user