summaryrefslogtreecommitdiff
path: root/src/encoder.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-09-16 09:29:43 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-09-16 09:29:43 +0200
commit06bdf2c4f96a6324b3fe667cebb03d44cd100a73 (patch)
treee7678e0f861ae538fe03c75484d708042f62659d /src/encoder.hpp
parentf78d9b6bfca13e298c29fadabbbc870b37a0a573 (diff)
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>
Diffstat (limited to 'src/encoder.hpp')
-rw-r--r--src/encoder.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/encoder.hpp b/src/encoder.hpp
index f7e3cbc..949cbdc 100644
--- a/src/encoder.hpp
+++ b/src/encoder.hpp
@@ -142,11 +142,20 @@ namespace zmq
private:
+ // Where to get the data to write from.
unsigned char *write_pos;
+
+ // How much data to write before next step should be executed.
size_t to_write;
+
+ // Next step. If set to NULL, it means that associated data stream
+ // is dead.
step_t next;
+
+ // If true, first byte of the message is being written.
bool beginning;
+ // The buffer for encoded data.
size_t bufsize;
unsigned char *buf;