diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-06-20 11:33:54 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-20 11:33:54 +0200 |
commit | ab99975ad44ed0fe9ab651f31cc47d493e7fb77e (patch) | |
tree | ec7d05592886bf48cb4ed60d10aa8f5eaf02dacd /src/pipe.cpp | |
parent | ada5d424721c0c0139b8011a5e9de348d061ba2f (diff) |
LABEL flag added to the wire format
So far there was no distinction between message parts used by 0MQ
and message parts used by user. Now, the message parts used by 0MQ
are marked as 'LABEL'.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r-- | src/pipe.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp index 9d9614b..1813ca0 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -125,7 +125,7 @@ bool zmq::pipe_t::read (msg_t *msg_) return false; } - if (!(msg_->flags () & msg_t::more)) + if (!(msg_->flags () & (msg_t::more | msg_t::label))) msgs_read++; if (lwm > 0 && msgs_read % lwm == 0) @@ -154,8 +154,9 @@ bool zmq::pipe_t::write (msg_t *msg_) if (unlikely (!check_write (msg_))) return false; - outpipe->write (*msg_, msg_->flags () & msg_t::more); - if (!(msg_->flags () & msg_t::more)) + bool more = msg_->flags () & (msg_t::more | msg_t::label); + outpipe->write (*msg_, more); + if (!more) msgs_written++; return true; @@ -167,7 +168,7 @@ void zmq::pipe_t::rollback () msg_t msg; if (outpipe) { while (outpipe->unwrite (&msg)) { - zmq_assert (msg.flags () & msg_t::more); + zmq_assert (msg.flags () & (msg_t::more | msg_t::label)); int rc = msg.close (); errno_assert (rc == 0); } |