Issue #1382: Do not send data to backend when there are no listeners (+ tests)

This commit is contained in:
Rik van der Heijden
2015-04-24 23:01:20 +02:00
parent dbacc34238
commit 7b9e9b838d
6 changed files with 121 additions and 2 deletions

View File

@@ -159,14 +159,16 @@ int zmq::proxy (
}
// Process a request
if (state == active
&& items [0].revents & ZMQ_POLLIN) {
&& items [0].revents & ZMQ_POLLIN
&& items [1].revents & ZMQ_POLLOUT) {
rc = forward(frontend_, backend_, capture_,msg);
if (unlikely (rc < 0))
return -1;
}
// Process a reply
if (state == active
&& items [1].revents & ZMQ_POLLIN) {
&& items [1].revents & ZMQ_POLLIN
&& items [0].revents & ZMQ_POLLOUT) {
rc = forward(backend_, frontend_, capture_,msg);
if (unlikely (rc < 0))
return -1;