mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 19:52:00 +01:00
Fixed issue with req assertions (issue 252)
Signed-off-by: Mikko Koppanen <mkoppanen@php.net> Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
committed by
Martin Sustrik
parent
e191e806ea
commit
8f8bfcaba0
@@ -89,8 +89,13 @@ int zmq::req_t::xrecv (msg_t *msg_, int flags_)
|
||||
int rc = xreq_t::xrecv (msg_, flags_);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
zmq_assert (msg_->flags () & msg_t::label);
|
||||
zmq_assert (msg_->size () == 4);
|
||||
|
||||
// TODO: This should also close the connection with the peer!
|
||||
if (unlikely (!(msg_->flags () & msg_t::label) || msg_->size () != 4)) {
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned char *data = (unsigned char*) msg_->data ();
|
||||
if (unlikely (get_uint32 (data) != request_id)) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user