From be159b63169474b644ebd38177bf4e808ebb5487 Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Mon, 13 Sep 2010 13:27:48 +0200 Subject: zmq::writer_t: Add missing test for swap --- src/pipe.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/pipe.cpp b/src/pipe.cpp index 0108d56..4551660 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -309,24 +309,24 @@ void zmq::writer_t::process_activate_writer (uint64_t msgs_read_) } if (!pipe->flush ()) send_activate_reader (reader); - } - // There are no more messages in the swap. We can switch into - // standard in-memory mode. - if (swap->empty ()) { - swapping = false; - - // Push delimiter into the pipe. Trick the compiler to belive that - // the tag is a valid pointer. Note that watermarks are not checked - // thus the delimiter can be written even though the pipe is full. - if (pending_delimiter) { - zmq_msg_t msg; - const unsigned char *offset = 0; - msg.content = (void*) (offset + ZMQ_DELIMITER); - msg.flags = 0; - pipe->write (msg, false); - flush (); - return; + // There are no more messages in the swap. We can switch into + // standard in-memory mode. + if (swap->empty ()) { + swapping = false; + + // Push delimiter into the pipe. Trick the compiler to belive that + // the tag is a valid pointer. Note that watermarks are not checked + // thus the delimiter can be written even though the pipe is full. + if (pending_delimiter) { + zmq_msg_t msg; + const unsigned char *offset = 0; + msg.content = (void*) (offset + ZMQ_DELIMITER); + msg.flags = 0; + pipe->write (msg, false); + flush (); + return; + } } } -- cgit v1.2.3