From 06bdf2c4f96a6324b3fe667cebb03d44cd100a73 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 16 Sep 2011 09:29:43 +0200 Subject: 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 --- src/req.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/req.hpp') diff --git a/src/req.hpp b/src/req.hpp index 2c2cbc4..0207a4f 100644 --- a/src/req.hpp +++ b/src/req.hpp @@ -67,8 +67,16 @@ namespace zmq const char *protocol_, const char *address_); ~req_session_t (); + // Overloads of the functions from session_base_t. + int write (msg_t *msg_); + private: + enum { + request_id, + body + } state; + req_session_t (const req_session_t&); const req_session_t &operator = (const req_session_t&); }; -- cgit v1.2.3