mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 13:47:13 +01:00
Fixed build: malformed only defined when needed.
This commit is contained in:
@@ -65,8 +65,9 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
|||||||
{
|
{
|
||||||
bool is_int = (optvallen_ == sizeof (int));
|
bool is_int = (optvallen_ == sizeof (int));
|
||||||
int value = is_int? *((int *) optval_): 0;
|
int value = is_int? *((int *) optval_): 0;
|
||||||
|
#if defined (ZMQ_ACT_MILITANT)
|
||||||
bool malformed = true; // Did caller pass a bad option value?
|
bool malformed = true; // Did caller pass a bad option value?
|
||||||
|
#endif
|
||||||
switch (option_) {
|
switch (option_) {
|
||||||
case ZMQ_SNDHWM:
|
case ZMQ_SNDHWM:
|
||||||
if (is_int && value >= 0) {
|
if (is_int && value >= 0) {
|
||||||
@@ -442,11 +443,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
#if defined (ZMQ_ACT_MILITANT)
|
||||||
// There are valid scenarios for probing with unknown socket option
|
// There are valid scenarios for probing with unknown socket option
|
||||||
// values, e.g. to check if security is enabled or not. This will not
|
// values, e.g. to check if security is enabled or not. This will not
|
||||||
// provoke a militant assert. However, passing bad values to a valid
|
// provoke a militant assert. However, passing bad values to a valid
|
||||||
// socket option will, if ZMQ_ACT_MILITANT is defined.
|
// socket option will, if ZMQ_ACT_MILITANT is defined.
|
||||||
malformed = false;
|
malformed = false;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if defined (ZMQ_ACT_MILITANT)
|
#if defined (ZMQ_ACT_MILITANT)
|
||||||
|
|||||||
Reference in New Issue
Block a user