From ef0e2fdc1b4d080d7cdf912660eaae8ec9103120 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Sep 2008 22:02:13 +0200 Subject: 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. --- src/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3