summaryrefslogtreecommitdiff
path: root/src/req.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/req.cpp')
-rw-r--r--src/req.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/req.cpp b/src/req.cpp
index 503f221..6a6b6a8 100644
--- a/src/req.cpp
+++ b/src/req.cpp
@@ -84,8 +84,12 @@ int zmq::req_t::xrecv (zmq_msg_t *msg_, int flags_)
int rc = xreq_t::xrecv (msg_, flags_);
if (rc != 0)
return rc;
- zmq_assert (msg_->flags & ZMQ_MSG_MORE);
- zmq_assert (zmq_msg_size (msg_) == 0);
+
+ // TODO: this should also close the connection with the peer
+ if (!(msg_->flags & ZMQ_MSG_MORE) || zmq_msg_size (msg_) != 0) {
+ errno = EAGAIN;
+ return -1;
+ }
message_begins = false;
}