summaryrefslogtreecommitdiff
path: root/src/rep.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-11-04 09:48:25 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-11-04 09:48:25 +0100
commit05ce301f3571e3e690792a189cb927328163f0bc (patch)
tree1145b921033a2b88e9b987ec1d3e03060559702d /src/rep.cpp
parenta8362abf11b51dd553766fb07a9e60f28e788126 (diff)
parent6cdd720400ea456ccbfdf09cdc5054ab07dbdc6f (diff)
Merge branch 'master' of github.com:zeromq/libzmq
Diffstat (limited to 'src/rep.cpp')
-rw-r--r--src/rep.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/rep.cpp b/src/rep.cpp
index 564fa89..02a825c 100644
--- a/src/rep.cpp
+++ b/src/rep.cpp
@@ -1,4 +1,5 @@
/*
+ Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2011 iMatix Corporation
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
@@ -42,7 +43,7 @@ int zmq::rep_t::xsend (msg_t *msg_, int flags_)
return -1;
}
- bool more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
+ bool more = msg_->flags () & msg_t::more ? true : false;
// Push message to the reply pipe.
int rc = xrep_t::xsend (msg_, flags_);
@@ -71,19 +72,20 @@ int zmq::rep_t::xrecv (msg_t *msg_, int flags_)
int rc = xrep_t::xrecv (msg_, flags_);
if (rc != 0)
return rc;
- if (!(msg_->flags () & msg_t::label))
- break;
+ zmq_assert (msg_->flags () & msg_t::more);
+ bool bottom = (msg_->size () == 0);
rc = xrep_t::xsend (msg_, flags_);
errno_assert (rc == 0);
+ if (bottom)
+ break;
}
request_begins = false;
}
- else {
- int rc = xrep_t::xrecv (msg_, flags_);
- if (rc != 0)
- return rc;
- }
- zmq_assert (!(msg_->flags () & msg_t::label));
+
+ // Get next message part to return to the user.
+ int rc = xrep_t::xrecv (msg_, flags_);
+ if (rc != 0)
+ return rc;
// If whole request is read, flip the FSM to reply-sending state.
if (!(msg_->flags () & msg_t::more)) {