mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 05:29:43 +01:00
Revert "The previous code to block the socket from receiving on that pipe during a disconnect was vulnerable to a race condition. This code calls with the terminate functions of both ends of the pipe - I believe this should be safer. This required storing a pointer to the socket end of the pipe"
This reverts commit 336f72720a.
This commit is contained in:
@@ -308,9 +308,6 @@ void zmq::session_base_t::process_attach (i_engine *engine_)
|
|||||||
|
|
||||||
// Ask socket to plug into the remote end of the pipe.
|
// Ask socket to plug into the remote end of the pipe.
|
||||||
send_bind (socket, pipes [1]);
|
send_bind (socket, pipes [1]);
|
||||||
|
|
||||||
// Store the outpipe for disconnect situations
|
|
||||||
outpipe = pipes [1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plug in the engine.
|
// Plug in the engine.
|
||||||
@@ -414,7 +411,8 @@ void zmq::session_base_t::detached ()
|
|||||||
if (pipe && options.delay_attach_on_connect == 1
|
if (pipe && options.delay_attach_on_connect == 1
|
||||||
&& addr->protocol != "pgm" && addr->protocol != "epgm") {
|
&& addr->protocol != "pgm" && addr->protocol != "epgm") {
|
||||||
pipe->terminate (false);
|
pipe->terminate (false);
|
||||||
outpipe->terminate (false);
|
socket->terminated (pipe);
|
||||||
|
pipe = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,9 +103,6 @@ namespace zmq
|
|||||||
|
|
||||||
// Pipe connecting the session to its socket.
|
// Pipe connecting the session to its socket.
|
||||||
zmq::pipe_t *pipe;
|
zmq::pipe_t *pipe;
|
||||||
|
|
||||||
// Socket end of the pipe, for delay attach scenario
|
|
||||||
zmq::pipe_t *outpipe;
|
|
||||||
|
|
||||||
// This flag is true if the remainder of the message being processed
|
// This flag is true if the remainder of the message being processed
|
||||||
// is still in the in pipe.
|
// is still in the in pipe.
|
||||||
|
|||||||
Reference in New Issue
Block a user