mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 23:36:04 +00:00
Added optval checking in zmq_ctx_set
This commit is contained in:
parent
eb8217bb28
commit
9728706b10
@ -128,13 +128,13 @@ int zmq::ctx_t::terminate ()
|
|||||||
int zmq::ctx_t::set (int option_, int optval_)
|
int zmq::ctx_t::set (int option_, int optval_)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
if (option_ == ZMQ_MAX_SOCKETS) {
|
if (option_ == ZMQ_MAX_SOCKETS && optval_ >= 1) {
|
||||||
opt_sync.lock ();
|
opt_sync.lock ();
|
||||||
max_sockets = optval_;
|
max_sockets = optval_;
|
||||||
opt_sync.unlock ();
|
opt_sync.unlock ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (option_ == ZMQ_IO_THREADS) {
|
if (option_ == ZMQ_IO_THREADS && optval_ >= 0) {
|
||||||
opt_sync.lock ();
|
opt_sync.lock ();
|
||||||
io_thread_count = optval_;
|
io_thread_count = optval_;
|
||||||
opt_sync.unlock ();
|
opt_sync.unlock ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user