From 92923cd40b645af844c5ed1055a0a45c6daa3c89 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 28 Aug 2010 08:44:12 +0200 Subject: bug in pipe deactivation fixed --- src/pipe.cpp | 8 +++----- src/socket_base.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pipe.cpp b/src/pipe.cpp index 5780635..8785330 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -80,11 +80,8 @@ bool zmq::reader_t::check_read () return false; // Check if there's an item in the pipe. - // If not, deactivate the pipe. - if (!pipe->check_read ()) { - terminate (); + if (!pipe->check_read ()) return false; - } // If the next item in the pipe is message delimiter, // initiate its termination. @@ -198,7 +195,8 @@ bool zmq::writer_t::check_write () if (terminating) return false; - if (pipe_full () && (msg_store == NULL || msg_store->full () || extra_msg_flag)) { + if (pipe_full () && (msg_store == NULL || msg_store->full () || + extra_msg_flag)) { stalled = true; return false; } diff --git a/src/socket_base.cpp b/src/socket_base.cpp index f575c0a..fe06d2f 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -244,7 +244,7 @@ int zmq::socket_base_t::getsockopt (int option_, void *optval_, errno = EINVAL; return -1; } - process_commands(false, false); + process_commands (false, false); *((uint32_t*) optval_) = 0; if (has_out ()) *((uint32_t*) optval_) |= ZMQ_POLLOUT; -- cgit v1.2.3