From 75f571c8844231f4172f131e1dd6ba2348eb54e5 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 19 Feb 2010 15:24:43 +0100 Subject: Multi-hop REQ/REP, part XII., generate unique identities for anonymous connections --- src/session.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 74bd8ae..05f319c 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -50,7 +50,7 @@ zmq::session_t::session_t (object_t *parent_, socket_base_t *owner_, peer_identity (peer_identity_), options (options_) { - if (!peer_identity.empty ()) { + if (!peer_identity.empty () && peer_identity [0] != 0) { if (!owner->register_session (peer_identity, this)) { // TODO: There's already a session with the specified @@ -103,7 +103,7 @@ void zmq::session_t::detach (owned_t *reconnecter_) engine = NULL; // Terminate transient session. - if (!ordinal && peer_identity.empty ()) + if (!ordinal && (peer_identity.empty () || peer_identity [0] == 0)) term (); } @@ -173,7 +173,7 @@ void zmq::session_t::process_unplug () // Unregister the session from the socket. if (ordinal) owner->unregister_session (ordinal); - else if (!peer_identity.empty ()) + else if (!peer_identity.empty () && peer_identity [0] != 0) owner->unregister_session (peer_identity); // Ask associated pipes to terminate. -- cgit v1.2.3