mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 04:17:57 +01:00
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>
This commit is contained in:
@@ -48,14 +48,14 @@ int zmq::req_t::xsend (msg_t *msg_, int flags_)
|
||||
msg_t prefix;
|
||||
int rc = prefix.init ();
|
||||
errno_assert (rc == 0);
|
||||
prefix.set_flags (msg_t::more);
|
||||
prefix.set_flags (msg_t::label);
|
||||
rc = xreq_t::xsend (&prefix, flags_);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
message_begins = false;
|
||||
}
|
||||
|
||||
bool more = msg_->flags () & msg_t::more;
|
||||
bool more = msg_->flags () & (msg_t::more | msg_t::label);
|
||||
|
||||
int rc = xreq_t::xsend (msg_, flags_);
|
||||
if (rc != 0)
|
||||
@@ -83,7 +83,7 @@ int zmq::req_t::xrecv (msg_t *msg_, int flags_)
|
||||
int rc = xreq_t::xrecv (msg_, flags_);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
zmq_assert (msg_->flags () & msg_t::more);
|
||||
zmq_assert (msg_->flags () & msg_t::label);
|
||||
zmq_assert (msg_->size () == 0);
|
||||
message_begins = false;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ int zmq::req_t::xrecv (msg_t *msg_, int flags_)
|
||||
return rc;
|
||||
|
||||
// If the reply is fully received, flip the FSM into request-sending state.
|
||||
if (!(msg_->flags () & msg_t::more)) {
|
||||
if (!(msg_->flags () & (msg_t::more | msg_t::label))) {
|
||||
receiving_reply = false;
|
||||
message_begins = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user