don't check for identity, if the connection is anonymous

This commit is contained in:
Martin Sustrik 2010-02-19 17:02:07 +01:00
parent aff1f6621a
commit 727054547f

View File

@ -198,9 +198,15 @@ void zmq::session_t::process_attach (i_engine *engine_,
{ {
if (!peer_identity.empty ()) { if (!peer_identity.empty ()) {
// If we already know the peer name do nothing, just check whether // If both IDs are temporary, no checking is needed.
// it haven't changed. // TODO: Old ID should be reused in this case...
zmq_assert (peer_identity == peer_identity_); 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 ()) { else if (!peer_identity_.empty ()) {