summaryrefslogtreecommitdiff
path: root/src/socket_base.cpp
diff options
context:
space:
mode:
authorChuck Remes <cremes@mac.com>2011-11-06 14:03:51 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-11-06 14:03:51 +0100
commit93529d8c5db599a45171942c4510f1b84ed09e6a (patch)
tree07ae1a6ff6f840eaa6ea1b2ffe8c76ce126f4237 /src/socket_base.cpp
parentbb66f3cc3bc2a76d10f16e1206f35480eb250a07 (diff)
Add zmq_getmsgopt to the API
The new function allows to retrieve options (flags) from zmq_msg_t. Signed-off-by: Chuck Remes <cremes@mac.com> Renamed from zmq_msg_flags to zmq_getmsgopt Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/socket_base.cpp')
-rw-r--r--src/socket_base.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index ced28d4..302003f 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -485,6 +485,9 @@ int zmq::socket_base_t::send (msg_t *msg_, int flags_)
if (unlikely (rc != 0))
return -1;
+ // Clear any user-visible flags that are set on the message.
+ msg_->reset_flags (msg_t::more);
+
// At this point we impose the flags on the message.
if (flags_ & ZMQ_SNDMORE)
msg_->set_flags (msg_t::more);
@@ -857,15 +860,10 @@ void zmq::socket_base_t::terminated (pipe_t *pipe_)
void zmq::socket_base_t::extract_flags (msg_t *msg_)
{
// Test whether IDENTITY flag is valid for this socket type.
- if (unlikely (msg_->flags () & msg_t::identity)) {
+ if (unlikely (msg_->flags () & msg_t::identity))
zmq_assert (options.recv_identity);
-printf ("identity recvd\n");
- }
-
// Remove MORE flag.
rcvmore = msg_->flags () & msg_t::more ? true : false;
- if (rcvmore)
- msg_->reset_flags (msg_t::more);
}