summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-02-23 22:13:56 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-02-23 22:13:56 +0100
commit2dd55605ea3956413cb25cab705ffdbdb2e00da5 (patch)
tree004206dbd57cabd665b0be4f008a427bcd5fc00f
parent025c9e173c58971993858ea66fb2eeaf08de195d (diff)
recv fails after polling for IN on REQ socket
-rw-r--r--src/req.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/req.cpp b/src/req.cpp
index 735f0aa..833db9a 100644
--- a/src/req.cpp
+++ b/src/req.cpp
@@ -191,16 +191,21 @@ int zmq::req_t::xrecv (zmq_msg_t *msg_, int flags_)
waiting_for_reply = false;
reply_pipe = NULL;
-
return 0;
}
bool zmq::req_t::xhas_in ()
{
- if (reply_pipe && reply_pipe->check_read ())
- return waiting_for_reply;
+ if (!waiting_for_reply || !reply_pipe_active)
+ return false;
+
+ zmq_assert (reply_pipe);
+ if (!reply_pipe->check_read ()) {
+ reply_pipe_active = false;
+ return false;
+ }
- return false;
+ return true;
}
bool zmq::req_t::xhas_out ()