Skip to content

Commit

Permalink
message flags from the wire are written to zmq_msg_t and vice versa
Browse files Browse the repository at this point in the history
  • Loading branch information
sustrik committed Mar 9, 2010
1 parent 531c6af commit 0f891e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/zmq_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/zmq_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0f891e0

Please sign in to comment.