Commit 1cfc3e17 authored by Doron Somech's avatar Doron Somech Committed by GitHub

Merge pull request #2353 from bluca/fix_test

Problem: unnecessary change to router_mandatory_hwm test
parents ca311f7b 0f473d14
......@@ -1120,13 +1120,7 @@ int zmq::socket_base_t::send (msg_t *msg_, int flags_)
if (rc == 0) {
return 0;
}
// In case of ZMQ_ROUTER_MANDATORY option set and peer disconnected
if (likely(errno == EHOSTUNREACH)) {
return -1;
}
if (unlikely(errno != EAGAIN)) {
if (unlikely (errno != EAGAIN)) {
return -1;
}
......
......@@ -84,15 +84,11 @@ int main (void)
const int BUF_SIZE = 65536;
char buf[BUF_SIZE];
memset(buf, 0, BUF_SIZE);
// Send first batch of messages
for(i = 0; i < 100000; ++i) {
if (TRACE_ENABLED)
fprintf(stderr, "Sending message %d ...\n", i);
if (TRACE_ENABLED) fprintf(stderr, "Sending message %d ...\n", i);
rc = zmq_send (router, "X", 1, ZMQ_DONTWAIT | ZMQ_SNDMORE);
if (rc == -1 && zmq_errno() == EHOSTUNREACH)
break;
if (rc == -1 && zmq_errno() == EAGAIN) break;
assert (rc == 1);
rc = zmq_send (router, buf, BUF_SIZE, ZMQ_DONTWAIT);
assert (rc == BUF_SIZE);
......@@ -100,17 +96,12 @@ int main (void)
// This should fail after one message but kernel buffering could
// skew results
assert (i < 10);
msleep (1000);
// Send second batch of messages
for(; i < 100000; ++i) {
if (TRACE_ENABLED)
fprintf(stderr, "Sending message %d (part 2) ...\n", i);
if (TRACE_ENABLED) fprintf(stderr, "Sending message %d (part 2) ...\n", i);
rc = zmq_send (router, "X", 1, ZMQ_DONTWAIT | ZMQ_SNDMORE);
if (rc == -1 && zmq_errno() == EHOSTUNREACH)
break;
if (rc == -1 && zmq_errno() == EAGAIN) break;
assert (rc == 1);
rc = zmq_send (router, buf, BUF_SIZE, ZMQ_DONTWAIT);
assert (rc == BUF_SIZE);
......@@ -119,8 +110,7 @@ int main (void)
// skew results
assert (i < 20);
if (TRACE_ENABLED)
fprintf(stderr, "Done sending messages.\n");
if (TRACE_ENABLED) fprintf(stderr, "Done sending messages.\n");
rc = zmq_close (router);
assert (rc == 0);
......
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