summaryrefslogtreecommitdiff
path: root/src/fq.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-05-30 10:07:34 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-30 10:07:34 +0200
commit0b59866a84f733e5a53b0d2f32570581691747ef (patch)
tree8861d97915544dc4385177931f299a6f27603c92 /src/fq.cpp
parent311fb0d852374e769d8ff791c9df38f0464960c6 (diff)
Patches from sub-forward branch incorporated
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/fq.cpp')
-rw-r--r--src/fq.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fq.cpp b/src/fq.cpp
index 7318822..63a50ff 100644
--- a/src/fq.cpp
+++ b/src/fq.cpp
@@ -63,6 +63,11 @@ void zmq::fq_t::activated (pipe_t *pipe_)
int zmq::fq_t::recv (msg_t *msg_, int flags_)
{
+ return recvpipe (msg_, flags_, NULL);
+}
+
+int zmq::fq_t::recvpipe (msg_t *msg_, int flags_, pipe_t **pipe_)
+{
// Deallocate old content of the message.
int rc = msg_->close ();
errno_assert (rc == 0);
@@ -83,6 +88,8 @@ int zmq::fq_t::recv (msg_t *msg_, int flags_)
// and replaced by another active pipe. Thus we don't have to increase
// the 'current' pointer.
if (fetched) {
+ if (pipe_)
+ *pipe_ = pipes [current];
more = msg_->flags () & msg_t::more;
if (!more) {
current++;