summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-03-09 17:24:42 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-03-09 17:24:42 +0100
commit0f891e091cc46775226ee1fe28784876395a7b92 (patch)
treeca22bddb7e575b90dd1619731cf93efa5d988dca /src
parent531c6af0d4df606ddef15da821dad20399b9480a (diff)
message flags from the wire are written to zmq_msg_t and vice versa
Diffstat (limited to 'src')
-rw-r--r--src/zmq_decoder.cpp4
-rw-r--r--src/zmq_encoder.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/zmq_decoder.cpp b/src/zmq_decoder.cpp
index 34bd618..c7e20e1 100644
--- a/src/zmq_decoder.cpp
+++ b/src/zmq_decoder.cpp
@@ -112,8 +112,8 @@ bool zmq::zmq_decoder_t::eight_byte_size_ready ()
bool zmq::zmq_decoder_t::flags_ready ()
{
- // No flags are accepted at the moment.
- zmq_assert (tmpbuf [0] == 0);
+ // Store the flags from the wire into the message structure.
+ in_progress.flags = tmpbuf [0];
if (prefix.empty ()) {
next_step (zmq_msg_data (&in_progress), zmq_msg_size (&in_progress),
diff --git a/src/zmq_encoder.cpp b/src/zmq_encoder.cpp
index 95d0e5e..d78d04f 100644
--- a/src/zmq_encoder.cpp
+++ b/src/zmq_encoder.cpp
@@ -97,13 +97,13 @@ bool zmq::zmq_encoder_t::message_ready ()
// message size. In both cases empty 'flags' field follows.
if (size < 255) {
tmpbuf [0] = (unsigned char) size;
- tmpbuf [1] = 0;
+ tmpbuf [1] = (in_progress.flags & ~ZMQ_MSG_SHARED);
next_step (tmpbuf, 2, &zmq_encoder_t::size_ready, true);
}
else {
tmpbuf [0] = 0xff;
put_uint64 (tmpbuf + 1, size);
- tmpbuf [9] = 0;
+ tmpbuf [9] = (in_progress.flags & ~ZMQ_MSG_SHARED);
next_step (tmpbuf, 10, &zmq_encoder_t::size_ready, true);
}
return true;