mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 15:26:04 +00:00
Fixing concurrency issue in rep.cpp resulting in broken connections with multiple requesters under heavy load.
This commit is contained in:
parent
84585a9561
commit
26ca5ed8c6
@ -178,14 +178,15 @@ int zmq::rep_t::xrecv (zmq_msg_t *msg_, int flags_)
|
||||
// Round-robin over the pipes to get next message.
|
||||
for (int count = active; count != 0; count--) {
|
||||
bool fetched = in_pipes [current]->read (msg_);
|
||||
current++;
|
||||
if (current >= active)
|
||||
current = 0;
|
||||
if (fetched) {
|
||||
reply_pipe = out_pipes [current];
|
||||
waiting_for_reply = true;
|
||||
return 0;
|
||||
}
|
||||
current++;
|
||||
if (current >= active)
|
||||
current = 0;
|
||||
if (fetched)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// No message is available. Initialise the output parameter
|
||||
|
Loading…
x
Reference in New Issue
Block a user