Commit 6347d392 authored by Arthur O'Dwyer's avatar Arthur O'Dwyer

Fix a bug in pipe_t::flush().

Static analysis says:
src\pipe.cpp(193): error V547: Expression is always false. Probably the '||' operator should be used here.

If flush() is called on a pipe whose state was
"terminated" or "double_terminated", the programmer's
intent was to return immediately. But in fact the
two conditions can never be true simultaneously, so
the early return never happens, and we may try to flush
a terminated pipe anyway.
parent 0886b7a2
......@@ -190,7 +190,7 @@ void zmq::pipe_t::rollback ()
void zmq::pipe_t::flush ()
{
// If terminate() was already called do nothing.
if (state == terminated && state == double_terminated)
if (state == terminated || state == double_terminated)
return;
// The peer does not exist anymore at this point.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment