Commit 9da0c6d6 authored by Simon Giesecke's avatar Simon Giesecke

Problem: goto jumping backwards

Solution: replace by for loop
parent 62e48f83
...@@ -181,20 +181,21 @@ bool zmq::pipe_t::read (msg_t *msg_) ...@@ -181,20 +181,21 @@ bool zmq::pipe_t::read (msg_t *msg_)
if (unlikely (state != active && state != waiting_for_delimiter)) if (unlikely (state != active && state != waiting_for_delimiter))
return false; return false;
read_message: for (bool payload_read = false; !payload_read;) {
if (!inpipe->read (msg_)) { if (!inpipe->read (msg_)) {
in_active = false; in_active = false;
return false; return false;
} }
// If this is a credential, save a copy and receive next message. // If this is a credential, save a copy and receive next message.
if (unlikely (msg_->is_credential ())) { if (unlikely (msg_->is_credential ())) {
const unsigned char *data = const unsigned char *data =
static_cast<const unsigned char *> (msg_->data ()); static_cast<const unsigned char *> (msg_->data ());
credential.set (data, msg_->size ()); credential.set (data, msg_->size ());
const int rc = msg_->close (); const int rc = msg_->close ();
zmq_assert (rc == 0); zmq_assert (rc == 0);
goto read_message; } else
payload_read = true;
} }
// If delimiter was read, start termination process of the pipe. // If delimiter was read, start termination process of the pipe.
......
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