summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-11-12 14:47:26 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-11-12 14:47:26 +0100
commit8abe67357ab905c5c86191c1d9005666f66b6ca0 (patch)
tree3570550b5eaab335b43ad4336bd406c04f495c42
parentc0217027ccd2267b05e017af436a842755d044b0 (diff)
parentf7123de9434a96794e6a7cd83b398ceb18c9de8b (diff)
Merge branch 'maint'
* maint: Fix socket_t::recv() hang scenario where initial call to process_commands() eats signal Conflicts: src/socket_base.cpp
-rw-r--r--AUTHORS1
-rw-r--r--src/socket_base.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index ecdd167..6a7fe1d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -26,6 +26,7 @@ Jacob Rideout <jacob.rideout@returnpath.net>
Joe Thornber <joe.thornber@gmail.com>
Jon Dyte <jon@totient.co.uk>
Kamil Shakirov <kamils80@gmail.com>
+Marc Rossi <mrossi19@gmail.com>
Martin Hurton <hurtonm@gmail.com>
Martin Lucina <mato@kotelna.sk>
Martin Pales <m.pales@gmail.com>
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index a10ed0e..bfaacb7 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -519,13 +519,15 @@ int zmq::socket_base_t::recv (::zmq_msg_t *msg_, int flags_)
// In blocking scenario, commands are processed over and over again until
// we are able to fetch a message.
+ bool block = (ticks != 0);
while (rc != 0) {
if (errno != EAGAIN)
return -1;
- if (unlikely (process_commands (true, false) != 0))
+ if (unlikely (process_commands (block, false) != 0))
return -1;
rc = xrecv (msg_, flags_);
ticks = 0;
+ block = true;
}
rcvmore = msg_->flags & ZMQ_MSG_MORE;