Client: use TimeoutMonitor to track connection timeout
Don't use a global loop over the whole client list.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user