aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-17 22:02:13 +0200
committerMax Kellermann <max@duempel.org>2008-09-17 22:02:13 +0200
commitef0e2fdc1b4d080d7cdf912660eaae8ec9103120 (patch)
treecf39198141147b682c8e937e9679b071f40308ea /src/client.c
parent79a14c9a10a6356fa9158e62f206c63833dcc632 (diff)
downloadmpd-ef0e2fdc1b4d080d7cdf912660eaae8ec9103120.tar.gz
mpd-ef0e2fdc1b4d080d7cdf912660eaae8ec9103120.tar.xz
mpd-ef0e2fdc1b4d080d7cdf912660eaae8ec9103120.zip
client: check expired after client_process_line()
The assertion on "!client_is_expired(client)" was wrong, because writing the command response may cause the client to become expired. Replace that assertion with a check.
Diffstat (limited to 'src/client.c')
-rw-r--r--src/client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c
index ac7e44b9a..052fdb6a8 100644
--- a/src/client.c
+++ b/src/client.c
@@ -417,7 +417,9 @@ static int client_input_received(struct client *client, int bytesRead)
if (ret == COMMAND_RETURN_KILL ||
ret == COMMAND_RETURN_CLOSE)
return ret;
- assert(!client_is_expired(client));
+ if (client_is_expired(client))
+ return COMMAND_RETURN_CLOSE;
+
client->bufferPos = client->bufferLength;
}
if (client->bufferLength == CLIENT_MAX_BUFFER_LENGTH) {