mirror of
https://github.com/zeromq/libzmq.git
synced 2025-09-26 15:59:34 +02:00
fq: bugfix - don't read msg from inactive pipe
This commit is contained in:
parent
8c25bab31d
commit
6b3c1798e7
@ -46,8 +46,11 @@ void zmq::fq_t::detach (reader_t *pipe_)
|
||||
{
|
||||
// Remove the pipe from the list; adjust number of active pipes
|
||||
// accordingly.
|
||||
if (pipes.index (pipe_) < active)
|
||||
if (pipes.index (pipe_) < active) {
|
||||
active--;
|
||||
if (current == active)
|
||||
current = 0;
|
||||
}
|
||||
pipes.erase (pipe_);
|
||||
}
|
||||
|
||||
@ -55,6 +58,8 @@ void zmq::fq_t::kill (reader_t *pipe_)
|
||||
{
|
||||
// Move the pipe to the list of inactive pipes.
|
||||
active--;
|
||||
if (current == active)
|
||||
current = 0;
|
||||
pipes.swap (pipes.index (pipe_), active);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user