Commit 033e311d authored by Ian Barber's avatar Ian Barber

Merge pull request #411 from Quuxplusone/fix-test_monitor-bug

Fix a bug reported on the mailing list.
parents 12833804 f718d2be
...@@ -36,39 +36,39 @@ void socket_monitor (void *s, int event_, zmq_event_data_t *data_) ...@@ -36,39 +36,39 @@ void socket_monitor (void *s, int event_, zmq_event_data_t *data_)
// listener specific // listener specific
case ZMQ_EVENT_LISTENING: case ZMQ_EVENT_LISTENING:
assert (data_->listening.fd > 0); assert (data_->listening.fd > 0);
assert (memcmp (data_->listening.addr, addr, 22)); assert (!strcmp (data_->listening.addr, addr));
events |= ZMQ_EVENT_LISTENING; events |= ZMQ_EVENT_LISTENING;
break; break;
case ZMQ_EVENT_ACCEPTED: case ZMQ_EVENT_ACCEPTED:
assert (data_->accepted.fd > 0); assert (data_->accepted.fd > 0);
assert (memcmp (data_->accepted.addr, addr, 22)); assert (!strcmp (data_->accepted.addr, addr));
events |= ZMQ_EVENT_ACCEPTED; events |= ZMQ_EVENT_ACCEPTED;
break; break;
// connecter specific // connecter specific
case ZMQ_EVENT_CONNECTED: case ZMQ_EVENT_CONNECTED:
assert (data_->connected.fd > 0); assert (data_->connected.fd > 0);
assert (memcmp (data_->connected.addr, addr, 22)); assert (!strcmp (data_->connected.addr, addr));
events |= ZMQ_EVENT_CONNECTED; events |= ZMQ_EVENT_CONNECTED;
break; break;
case ZMQ_EVENT_CONNECT_DELAYED: case ZMQ_EVENT_CONNECT_DELAYED:
assert (data_->connect_delayed.err != 0); assert (data_->connect_delayed.err != 0);
assert (memcmp (data_->connect_delayed.addr, addr, 22)); assert (!strcmp (data_->connect_delayed.addr, addr));
events |= ZMQ_EVENT_CONNECT_DELAYED; events |= ZMQ_EVENT_CONNECT_DELAYED;
break; break;
// generic - either end of the socket // generic - either end of the socket
case ZMQ_EVENT_CLOSE_FAILED: case ZMQ_EVENT_CLOSE_FAILED:
assert (data_->close_failed.err != 0); assert (data_->close_failed.err != 0);
assert (memcmp (data_->close_failed.addr, addr, 22)); assert (!strcmp (data_->close_failed.addr, addr));
events |= ZMQ_EVENT_CLOSE_FAILED; events |= ZMQ_EVENT_CLOSE_FAILED;
break; break;
case ZMQ_EVENT_CLOSED: case ZMQ_EVENT_CLOSED:
assert (data_->closed.fd != 0); assert (data_->closed.fd != 0);
assert (memcmp (data_->closed.addr, addr, 22)); assert (!strcmp (data_->closed.addr, addr));
events |= ZMQ_EVENT_CLOSED; events |= ZMQ_EVENT_CLOSED;
break; break;
case ZMQ_EVENT_DISCONNECTED: case ZMQ_EVENT_DISCONNECTED:
assert (data_->disconnected.fd != 0); assert (data_->disconnected.fd != 0);
assert (memcmp (data_->disconnected.addr, addr, 22)); assert (!strcmp (data_->disconnected.addr, addr));
events |= ZMQ_EVENT_DISCONNECTED; events |= ZMQ_EVENT_DISCONNECTED;
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment