aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-17 22:02:13 +0200
committerEric Wong <normalperson@yhbt.net>2008-09-17 14:23:36 -0700
commitf851baf8c6e7cfc8d8b2bf904d8c090e70618190 (patch)
tree0aff3212953a7e4e340e1279d0c60f9e27738548 /src
parenta7b17bf7f5e423c39d3c6af45cb73b9cce93f1a3 (diff)
downloadmpd-f851baf8c6e7cfc8d8b2bf904d8c090e70618190.tar.gz
mpd-f851baf8c6e7cfc8d8b2bf904d8c090e70618190.tar.xz
mpd-f851baf8c6e7cfc8d8b2bf904d8c090e70618190.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')
-rw-r--r--src/client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c
index c3ed7fec5..9357b81ae 100644
--- a/src/client.c
+++ b/src/client.c
@@ -417,7 +417,8 @@ static int client_input_received(struct client *cl, int bytesRead)
if (ret == COMMAND_RETURN_KILL ||
ret == COMMAND_RETURN_CLOSE)
return ret;
- assert(!client_is_expired(cl));
+ if (client_is_expired(cl))
+ return COMMAND_RETURN_CLOSE;
cl->bufferPos = cl->bufferLength;
}
if (cl->bufferLength == CLIENT_MAX_BUFFER_LENGTH) {