Problem: CURVE server (connect) fails when client rebinds

Solution: if a CURVE server is using zmq_connect, the same session
will be used for any client "reconnect" (actual binds). This is
acceptable, so do not assert if zap_pipe already exists during the
handshake, but simply reuse it.
Fixes #2608
This commit is contained in:
Luca Boccassi 2017-07-01 17:37:07 +01:00
parent 4e6c89e3cd
commit d04065b778

View File

@ -323,7 +323,8 @@ void zmq::session_base_t::process_plug ()
// security flaw. // security flaw.
int zmq::session_base_t::zap_connect () int zmq::session_base_t::zap_connect ()
{ {
zmq_assert (zap_pipe == NULL); if (zap_pipe != NULL)
return 0;
endpoint_t peer = find_endpoint ("inproc://zeromq.zap.01"); endpoint_t peer = find_endpoint ("inproc://zeromq.zap.01");
if (peer.socket == NULL) { if (peer.socket == NULL) {