Merge pull request #284 from pieterh/master

Fixed issue LIBZMQ-344 - Implementation of ZMQ_FAIL_UNROUTABLE is broken
This commit is contained in:
Ian Barber 2012-03-22 03:31:02 -07:00
commit 84707d3feb

View File

@ -85,14 +85,11 @@ int zmq::xrep_t::xsetsockopt (int option_, const void *optval_,
errno = EINVAL;
return -1;
}
if(sizeof(optvallen_) != sizeof(int)) {
if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
errno = EINVAL;
return -1;
}
fail_unroutable = *((const int*) optval_);
return 0;
}