client/Idle: consume only idle flags that were subscribed to
Since the very beginning when idle subscriptions where introduced
(commit 0bad84066b
), waiting for a certain idle mask would clear
all other idle flags as well. This would cause idle events to get
lost.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1998
This commit is contained in:
@@ -26,9 +26,11 @@ void
|
||||
Client::IdleNotify() noexcept
|
||||
{
|
||||
assert(idle_waiting);
|
||||
assert(idle_flags != 0);
|
||||
|
||||
unsigned flags = std::exchange(idle_flags, 0) & idle_subscriptions;
|
||||
const unsigned flags = idle_flags & idle_subscriptions;
|
||||
idle_flags &= ~idle_subscriptions;
|
||||
assert(flags != 0);
|
||||
|
||||
idle_waiting = false;
|
||||
|
||||
Response r(*this, 0);
|
||||
|
Reference in New Issue
Block a user