[zeromq-dev] labels and the behavior of XREQ/XREP

Pieter Hintjens ph at imatix.com
Fri Sep 16 19:02:12 CEST 2011


On Fri, Sep 16, 2011 at 11:39 AM, Chuck Remes <cremes.devlist at mac.com> wrote:

> The thread appeared to have consensus that this behavior was incorrect and surprising. Instead, each label part should also return true for RCVMORE.

I've fixed this in 3-0 master. Patch is attached for Martin if he
wants to port this to 4.0.

-Pieter


diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 89cf835..543e3d2 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -596,7 +596,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
         if (rcvlabel)
             msg_->reset_flags (msg_t::label);
         rcvmore = msg_->flags () & msg_t::more ? true : false;
-        if (rcvmore)
+        if (rcvmore || rcvlabel)
             msg_->reset_flags (msg_t::more);
         return 0;
     }
@@ -617,7 +617,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
         if (rcvlabel)
             msg_->reset_flags (msg_t::label);
         rcvmore = msg_->flags () & msg_t::more ? true : false;
-        if (rcvmore)
+        if (rcvmore || rcvlabel)
             msg_->reset_flags (msg_t::more);
         return 0;
     }
@@ -656,7 +656,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
     if (rcvlabel)
         msg_->reset_flags (msg_t::label);
     rcvmore = msg_->flags () & msg_t::more ? true : false;
-    if (rcvmore)
+    if (rcvmore || rcvlabel)
         msg_->reset_flags (msg_t::more);
     return 0;
 }



More information about the zeromq-dev mailing list