summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-09-14 14:31:09 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-09-14 14:31:09 +0200
commitcf499ee016340a8534e24084a481a02498b44e70 (patch)
tree0fffc475a7332985fae42774e1cab18e5ca60ced
parent42737f09180b8ebc2827743568e6170b6ddd5938 (diff)
Bug in message distribution algorithm fixed (issue 251)
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r--src/dist.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/dist.cpp b/src/dist.cpp
index 23e790d..79baf43 100644
--- a/src/dist.cpp
+++ b/src/dist.cpp
@@ -142,11 +142,9 @@ void zmq::dist_t::distribute (msg_t *msg_, int flags_)
msg_->add_refs ((int) matching - 1);
// Push copy of the message to each matching pipe.
- for (pipes_t::size_type i = 0; i < matching;) {
+ for (pipes_t::size_type i = 0; i < matching; ++i) {
if (!write (pipes [i], msg_))
msg_->rm_refs (1);
- else
- i++;
}
// Detach the original message from the data buffer. Note that we don't