diff options
author | Max Kellermann <max@duempel.org> | 2013-01-16 21:39:40 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-16 21:51:08 +0100 |
commit | b0bbb8b693d846c2710ec84bfa79dcaa3a21729a (patch) | |
tree | 43cba39160446e9379c188ebb23eae5633de4ea7 /src/ClientIdle.cxx | |
parent | cab84af72e373acca0e88d9b407aa97796c083e0 (diff) | |
download | mpd-b0bbb8b693d846c2710ec84bfa79dcaa3a21729a.tar.gz mpd-b0bbb8b693d846c2710ec84bfa79dcaa3a21729a.tar.xz mpd-b0bbb8b693d846c2710ec84bfa79dcaa3a21729a.zip |
Client: use TimeoutMonitor to track connection timeout
Don't use a global loop over the whole client list.
Diffstat (limited to 'src/ClientIdle.cxx')
-rw-r--r-- | src/ClientIdle.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ClientIdle.cxx b/src/ClientIdle.cxx index b440a8260..89cb10aa1 100644 --- a/src/ClientIdle.cxx +++ b/src/ClientIdle.cxx @@ -43,7 +43,8 @@ Client::IdleNotify() } client_puts(this, "OK\n"); - g_timer_start(last_activity); + + TimeoutMonitor::ScheduleSeconds(client_timeout); } void @@ -83,6 +84,9 @@ Client::IdleWait(unsigned flags) if (idle_flags & idle_subscriptions) { IdleNotify(); return true; - } else + } else { + /* disable timeouts while in "idle" */ + TimeoutMonitor::Cancel(); return false; + } } |