From 23e018f37aaefcc1d2219e2c51e4bd3ddd9bd9bd Mon Sep 17 00:00:00 2001 From: sigiesec Date: Thu, 31 Aug 2017 21:00:01 +0200 Subject: [PATCH] Problem: termination is requested from a session's owner when already in pending termination while processing an error Solution: terminate pipe instead Fixes #2723 --- src/session_base.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/session_base.cpp b/src/session_base.cpp index ebef8a7a..98d5cf19 100644 --- a/src/session_base.cpp +++ b/src/session_base.cpp @@ -434,13 +434,19 @@ void zmq::session_base_t::engine_error ( switch (reason) { case stream_engine_t::timeout_error: case stream_engine_t::connection_error: - if (active) + if (active) { reconnect (); - else - terminate (); - break; + break; + } case stream_engine_t::protocol_error: - terminate (); + if (pending) { + if (pipe) + pipe->terminate (0); + if (zap_pipe) + zap_pipe->terminate (0); + } else { + terminate (); + } break; }