diff options
| author | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:57 +0100 | 
|---|---|---|
| committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:57 +0100 | 
| commit | b593ea30833ad5dcacb9076c988aec31b0cf26ec (patch) | |
| tree | 3d0c6f1dadfa2d947cf23f6109bb27b01ab202af /src/rep.cpp | |
| parent | cbaa7cfa93893876e4fd8794b6ea39f4d245b6b5 (diff) | |
Imported Upstream version 2.1.7upstream/2.1.7
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; | 
