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/ClientRead.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/ClientRead.cxx')
-rw-r--r-- | src/ClientRead.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ClientRead.cxx b/src/ClientRead.cxx index 363363d1f..49c698bc1 100644 --- a/src/ClientRead.cxx +++ b/src/ClientRead.cxx @@ -28,13 +28,13 @@ BufferedSocket::InputResult Client::OnSocketInput(const void *data, size_t length) { - g_timer_start(last_activity); - const char *p = (const char *)data; const char *newline = (const char *)memchr(p, '\n', length); if (newline == NULL) return InputResult::MORE; + TimeoutMonitor::ScheduleSeconds(client_timeout); + char *line = g_strndup(p, newline - p); BufferedSocket::ConsumeInput(newline + 1 - p); |