diff options
author | Martin Lucina <mato@kotelna.sk> | 2011-05-13 12:43:09 +0200 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:59 +0100 |
commit | ad3e013f74d309b86e8f087932203e5787fe2d2d (patch) | |
tree | a872da7e7338a0bb27b92ef1f198689873b86978 /src/rep.cpp | |
parent | f34d1599a651dd0b8feba2397f87629733988384 (diff) | |
parent | b593ea30833ad5dcacb9076c988aec31b0cf26ec (diff) |
Imported Debian patch 2.1.7-1debian/2.1.7-1
Diffstat (limited to 'src/rep.cpp')
-rw-r--r-- | src/rep.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/rep.cpp b/src/rep.cpp index 46c35cb..dc55ad0 100644 --- a/src/rep.cpp +++ b/src/rep.cpp @@ -78,14 +78,21 @@ int zmq::rep_t::xrecv (zmq_msg_t *msg_, int flags_) int rc = xrep_t::xrecv (msg_, flags_); if (rc != 0) return rc; - zmq_assert (msg_->flags & ZMQ_MSG_MORE); - // Empty message part delimits the traceback stack. - bottom = (zmq_msg_size (msg_) == 0); - - // Push it to the reply pipe. - rc = xrep_t::xsend (msg_, flags_); - zmq_assert (rc == 0); + if ((msg_->flags & ZMQ_MSG_MORE)) { + // Empty message part delimits the traceback stack. + bottom = (zmq_msg_size (msg_) == 0); + + // Push it to the reply pipe. + rc = xrep_t::xsend (msg_, flags_); + zmq_assert (rc == 0); + } + else { + // If the traceback stack is malformed, discard anything + // already sent to pipe (we're at end of invalid message). + rc = xrep_t::rollback (); + zmq_assert (rc == 0); + } } request_begins = false; |