Commit be159b63 authored by Martin Lucina's avatar Martin Lucina Committed by Martin Sustrik

zmq::writer_t: Add missing test for swap

parent 92f9136c
......@@ -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;
}
}
}
......
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