diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-11-01 13:39:54 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-11-01 13:39:54 +0100 |
commit | 7842c7107358324e8c5b9af7272e6dcab8c97931 (patch) | |
tree | d97f0e869ea0d95c60d41c96b48627c38e9c464c /src/rep.cpp | |
parent | 626099aa2a292178872843c55cc5226e6850f2ed (diff) |
LABELS and COMMANDs removed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/rep.cpp')
-rw-r--r-- | src/rep.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/rep.cpp b/src/rep.cpp index de99c8a..02a825c 100644 --- a/src/rep.cpp +++ b/src/rep.cpp @@ -43,7 +43,7 @@ int zmq::rep_t::xsend (msg_t *msg_, int flags_) return -1; } - bool more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false; + bool more = msg_->flags () & msg_t::more ? true : false; // Push message to the reply pipe. int rc = xrep_t::xsend (msg_, flags_); @@ -72,19 +72,20 @@ int zmq::rep_t::xrecv (msg_t *msg_, int flags_) int rc = xrep_t::xrecv (msg_, flags_); if (rc != 0) return rc; - if (!(msg_->flags () & msg_t::label)) - break; + zmq_assert (msg_->flags () & msg_t::more); + bool bottom = (msg_->size () == 0); rc = xrep_t::xsend (msg_, flags_); errno_assert (rc == 0); + if (bottom) + break; } request_begins = false; } - else { - int rc = xrep_t::xrecv (msg_, flags_); - if (rc != 0) - return rc; - } - zmq_assert (!(msg_->flags () & msg_t::label)); + + // Get next message part to return to the user. + int rc = xrep_t::xrecv (msg_, flags_); + if (rc != 0) + return rc; // If whole request is read, flip the FSM to reply-sending state. if (!(msg_->flags () & msg_t::more)) { |