summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-02-19 17:02:07 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-02-19 17:02:07 +0100
commit727054547f32680f7db098497c2d7b1a0b20e2d8 (patch)
treee0749c7c6cd024e08db5cde0ce33da7bbe5471d5
parentaff1f6621ae13083c7f15f7f1f808560254a2dcb (diff)
don't check for identity, if the connection is anonymous
-rw-r--r--src/session.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/session.cpp b/src/session.cpp
index 05f319c..e1d0b8e 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -198,9 +198,15 @@ void zmq::session_t::process_attach (i_engine *engine_,
{
if (!peer_identity.empty ()) {
- // If we already know the peer name do nothing, just check whether
- // it haven't changed.
- zmq_assert (peer_identity == peer_identity_);
+ // If both IDs are temporary, no checking is needed.
+ // TODO: Old ID should be reused in this case...
+ if (peer_identity.empty () || peer_identity [0] != 0 ||
+ peer_identity_.empty () || peer_identity_ [0] != 0) {
+
+ // If we already know the peer name do nothing, just check whether
+ // it haven't changed.
+ zmq_assert (peer_identity == peer_identity_);
+ }
}
else if (!peer_identity_.empty ()) {