summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-04-22 07:51:24 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-04-22 07:51:24 +0200
commit10fbc78e5cab494c3af727f5ea451fdced1c9d95 (patch)
tree8b29dfd2e0810217aba3ccdef3f3572a96188e2d /src
parente0246e32d79d71f8e73207b43aed8b23648e4fc7 (diff)
Assert during SUB socket termination fixed.
Fair queueing algorithm was checking whether the current pipe is not closed in the middle of reading a multipart message. However, this is OK when the socket is closing down. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src')
-rw-r--r--src/fq.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/fq.cpp b/src/fq.cpp
index 20dc769..ef68016 100644
--- a/src/fq.cpp
+++ b/src/fq.cpp
@@ -55,10 +55,9 @@ void zmq::fq_t::attach (reader_t *pipe_)
void zmq::fq_t::terminated (reader_t *pipe_)
{
- // TODO: This is a problem with session-initiated termination. It breaks
- // message atomicity. However, for socket initiated termination it's
- // just fine.
- zmq_assert (!more || pipes [current] != pipe_);
+ // Make sure that we are not closing current pipe while
+ // message is half-read.
+ zmq_assert (terminating || (!more || pipes [current] != pipe_));
// Remove the pipe from the list; adjust number of active pipes
// accordingly.