ZMQ_GSSAPI_PLAINTEXT option for disabling encryption

This commit is contained in:
Chris Busbey
2014-04-23 11:01:54 -07:00
parent 18da8a7402
commit 27591d2da6
7 changed files with 47 additions and 6 deletions

View File

@@ -54,7 +54,8 @@ zmq::options_t::options_t () :
mechanism (ZMQ_NULL),
as_server (0),
socket_id (0),
conflate (false)
conflate (false),
gss_plaintext (false)
{
}
@@ -427,6 +428,14 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break;
case ZMQ_GSSAPI_PLAINTEXT:
if (is_int && (value == 0 || value == 1)) {
gss_plaintext = (value != 0);
return 0;
}
break;
default:
break;
}
@@ -730,6 +739,14 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break;
case ZMQ_GSSAPI_PLAINTEXT:
if (is_int) {
*value = gss_plaintext;
return 0;
}
break;
}
errno = EINVAL;
return -1;