From d04065b77849d1f14a073b19d329b61ddc2db857 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 1 Jul 2017 17:37:07 +0100 Subject: [PATCH] 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 --- src/session_base.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session_base.cpp b/src/session_base.cpp index da771f74..0e8ba8d9 100644 --- a/src/session_base.cpp +++ b/src/session_base.cpp @@ -323,7 +323,8 @@ void zmq::session_base_t::process_plug () // security flaw. 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"); if (peer.socket == NULL) {