gssapi: move new options to DRAFT section

Problem: The new GSSAPI NAMESPACE options should have been
added to the DRAFT section of the API so they can be changed
until stabilized.

Solution:
- Move defines to the DRAFT section of zmq.h
- Duplicate them in zmq_draft.h, as is the local custom
- Compile only if defined (ZMQ_BUILD_DRAFT_API)
- Refactor internals slightly to avoid #ifdef hell
This commit is contained in:
Jim Garlick
2017-04-24 13:55:35 -07:00
parent c49436ad94
commit 9fbf2e2eb6
8 changed files with 52 additions and 20 deletions

View File

@@ -69,8 +69,10 @@ zmq::options_t::options_t () :
tcp_keepalive_intvl (-1),
mechanism (ZMQ_NULL),
as_server (0),
#ifdef ZMQ_BUILD_DRAFT_API
gss_principal_nt (ZMQ_GSSAPI_NT_HOSTBASED),
gss_service_principal_nt (ZMQ_GSSAPI_NT_HOSTBASED),
#endif
gss_plaintext (false),
socket_id (0),
conflate (false),
@@ -511,6 +513,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
}
break;
#ifdef ZMQ_BUILD_DRAFT_API
case ZMQ_GSSAPI_PRINCIPAL_NAMETYPE:
if (is_int && (value == ZMQ_GSSAPI_NT_HOSTBASED
|| value == ZMQ_GSSAPI_NT_USER_NAME
@@ -527,6 +530,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
}
break;
#endif
#endif
case ZMQ_HANDSHAKE_IVL: