Commit c28af41c authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #356 from hurtonm/code_cleanup

lb: code cleanup
parents bc150de8 89ff277b
...@@ -79,8 +79,7 @@ int zmq::lb_t::send (msg_t *msg_, int flags_) ...@@ -79,8 +79,7 @@ int zmq::lb_t::send (msg_t *msg_, int flags_)
if (dropping) { if (dropping) {
more = msg_->flags () & msg_t::more ? true : false; more = msg_->flags () & msg_t::more ? true : false;
if (!more) dropping = more;
dropping = false;
int rc = msg_->close (); int rc = msg_->close ();
errno_assert (rc == 0); errno_assert (rc == 0);
...@@ -90,10 +89,8 @@ int zmq::lb_t::send (msg_t *msg_, int flags_) ...@@ -90,10 +89,8 @@ int zmq::lb_t::send (msg_t *msg_, int flags_)
} }
while (active > 0) { while (active > 0) {
if (pipes [current]->write (msg_)) { if (pipes [current]->write (msg_))
more = msg_->flags () & msg_t::more ? true : false;
break; break;
}
zmq_assert (!more); zmq_assert (!more);
active--; active--;
...@@ -111,6 +108,7 @@ int zmq::lb_t::send (msg_t *msg_, int flags_) ...@@ -111,6 +108,7 @@ int zmq::lb_t::send (msg_t *msg_, int flags_)
// If it's final part of the message we can fluch it downstream and // If it's final part of the message we can fluch it downstream and
// continue round-robinning (load balance). // continue round-robinning (load balance).
more = msg_->flags () & msg_t::more? true: false;
if (!more) { if (!more) {
pipes [current]->flush (); pipes [current]->flush ();
current = (current + 1) % active; current = (current + 1) % active;
......
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