0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-29 08:39:42 +08:00

Properly set mechanism to CURVE when setting a curve option

This commit is contained in:
Pieter Hintjens 2013-06-22 11:05:01 +02:00
parent 10f69c1500
commit 8c0ded5076

View File

@ -296,6 +296,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
case ZMQ_CURVE_PUBLICKEY:
if (optvallen_ == CURVE_KEYSIZE) {
memcpy (curve_public_key, optval_, CURVE_KEYSIZE);
mechanism = ZMQ_CURVE;
return 0;
}
break;
@ -303,6 +304,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
case ZMQ_CURVE_SECRETKEY:
if (optvallen_ == CURVE_KEYSIZE) {
memcpy (curve_secret_key, optval_, CURVE_KEYSIZE);
mechanism = ZMQ_CURVE;
return 0;
}
break;
@ -310,6 +312,8 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
case ZMQ_CURVE_SERVERKEY:
if (optvallen_ == CURVE_KEYSIZE) {
memcpy (curve_server_key, optval_, CURVE_KEYSIZE);
as_server = 0;
mechanism = ZMQ_CURVE;
return 0;
}
break;