From 1f10208ad065c01e172669affdd48b6f2698ff4c Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sun, 19 Sep 2010 08:42:19 +0200 Subject: termination of pipe via delimiter message could stuck when no data were read from the pipe (because connection wasn't active) -- fixed --- src/session.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/session.cpp b/src/session.cpp index eb8967a..d116518 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -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. -- cgit v1.2.3