mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-19 18:03:50 +00:00
Problem: goto jumping backwards
Solution: replace by for loop
This commit is contained in:
parent
62e48f837d
commit
9da0c6d62f
@ -181,7 +181,7 @@ 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;
|
||||||
@ -194,7 +194,8 @@ read_message:
|
|||||||
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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user