>From cf499ee016340a8534e24084a481a02498b44e70 Mon Sep 17 00:00:00 2001
From: Martin Sustrik <[email protected]>
Date: Wed, 14 Sep 2011 14:31:09 +0200
Subject: [PATCH] Bug in message distribution algorithm fixed (issue 251)

Signed-off-by: Martin Sustrik <[email protected]>
---
 src/dist.cpp |    4 +---
 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
-- 
1.7.0.4

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to