mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 19:52:00 +01:00
drop connection requests with duplicate peer identity
Signed-off-by: Dhammika Pathirana <dhammika@gmail.com>
This commit is contained in:
committed by
Martin Sustrik
parent
401986e6bb
commit
465da7b17e
@@ -231,6 +231,13 @@ void zmq::session_t::process_attach (i_engine *engine_,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the session already has an engine attached, destroy new one.
|
||||||
|
// Note new engine is not plugged in yet, we don't have to unplug it.
|
||||||
|
if (engine) {
|
||||||
|
delete engine_;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check whether the required pipes already exist. If not so, we'll
|
// Check whether the required pipes already exist. If not so, we'll
|
||||||
// create them and bind them to the socket object.
|
// create them and bind them to the socket object.
|
||||||
if (!pipes_attached) {
|
if (!pipes_attached) {
|
||||||
@@ -257,8 +264,6 @@ void zmq::session_t::process_attach (i_engine *engine_,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Plug in the engine.
|
// Plug in the engine.
|
||||||
zmq_assert (!engine);
|
|
||||||
zmq_assert (engine_);
|
|
||||||
engine = engine_;
|
engine = engine_;
|
||||||
engine->plug (io_thread, this);
|
engine->plug (io_thread, this);
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace zmq
|
|||||||
void process_plug ();
|
void process_plug ();
|
||||||
void process_unplug ();
|
void process_unplug ();
|
||||||
|
|
||||||
// Associated wite-protocol engine.
|
// Associated wire-protocol engine.
|
||||||
i_engine *engine;
|
i_engine *engine;
|
||||||
|
|
||||||
// True if our own identity was already sent to the peer.
|
// True if our own identity was already sent to the peer.
|
||||||
|
|||||||
Reference in New Issue
Block a user