mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-17 16:43:58 +00:00
fix scope of itemsout poll
indentation was correct, but poll was inside `if control`, causing it to only be called if there is a control message. This would cause proxy messages to only be delivered after a control message had been sent.
This commit is contained in:
parent
1a0cceac43
commit
0f10ef1b38
@ -93,18 +93,18 @@ int zmq::proxy (
|
|||||||
if (unlikely (rc < 0))
|
if (unlikely (rc < 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// Process a control command if any
|
|
||||||
if (control_ && items [2].revents & ZMQ_POLLIN) {
|
|
||||||
rc = control_->recv (&msg, 0);
|
|
||||||
if (unlikely (rc < 0))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// Get the pollout separately because when combining this with pollin it maxes the CPU
|
// Get the pollout separately because when combining this with pollin it maxes the CPU
|
||||||
// because pollout shall most of the time return directly
|
// because pollout shall most of the time return directly
|
||||||
rc = zmq_poll (&itemsout [0], 2, 0);
|
rc = zmq_poll (&itemsout [0], 2, 0);
|
||||||
if (unlikely (rc < 0))
|
if (unlikely (rc < 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
// Process a control command if any
|
||||||
|
if (control_ && items [2].revents & ZMQ_POLLIN) {
|
||||||
|
rc = control_->recv (&msg, 0);
|
||||||
|
if (unlikely (rc < 0))
|
||||||
|
return -1;
|
||||||
|
|
||||||
moresz = sizeof more;
|
moresz = sizeof more;
|
||||||
rc = control_->getsockopt (ZMQ_RCVMORE, &more, &moresz);
|
rc = control_->getsockopt (ZMQ_RCVMORE, &more, &moresz);
|
||||||
if (unlikely (rc < 0) || more)
|
if (unlikely (rc < 0) || more)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user