0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-31 01:43:02 +08:00

termination of pipe via delimiter message could stuck when no data were read from the pipe (because connection wasn't active) -- fixed

This commit is contained in:
Martin Sustrik 2010-09-19 08:42:19 +02:00
parent 5153b6368b
commit 1f10208ad0

View File

@ -160,6 +160,13 @@ void zmq::session_t::process_plug ()
void zmq::session_t::finalise ()
{
// There may be delimiter waiting in the inbound pipe, never to be read
// because the connection cannot be established. In order to terminate
// decently in such case, do check_read which will in turn start the pipe
// termination process if there's delimiter in it.
if (in_pipe)
in_pipe->check_read ();
// If all conditions are met, proceed with termination:
// 1. Owner object already asked us to terminate.
// 2. The pipes were already attached to the session.