From b0bbb8b693d846c2710ec84bfa79dcaa3a21729a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Jan 2013 21:39:40 +0100 Subject: Client: use TimeoutMonitor to track connection timeout Don't use a global loop over the whole client list. --- src/ClientIdle.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ClientIdle.cxx') diff --git a/src/ClientIdle.cxx b/src/ClientIdle.cxx index b440a826..89cb10aa 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; + } } -- cgit v1.2.3