summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-09-13 13:27:48 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-13 13:27:48 +0200
commitbe159b63169474b644ebd38177bf4e808ebb5487 (patch)
tree16dcf785ff5964fbae4a381ceb9558a2f1b09b4a /src
parent92f9136ca6c69d2d1588ff5ff65e668e40e0f7eb (diff)
zmq::writer_t: Add missing test for swap
Diffstat (limited to 'src')
-rw-r--r--src/pipe.cpp34
1 files changed, 17 insertions, 17 deletions
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;
+ }
}
}