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.
This commit is contained in:
Max Kellermann 2008-09-17 22:02:13 +02:00
parent 79a14c9a10
commit ef0e2fdc1b

View File

@ -417,7 +417,9 @@ static int client_input_received(struct client *client, int bytesRead)
if (ret == COMMAND_RETURN_KILL || if (ret == COMMAND_RETURN_KILL ||
ret == COMMAND_RETURN_CLOSE) ret == COMMAND_RETURN_CLOSE)
return ret; return ret;
assert(!client_is_expired(client)); if (client_is_expired(client))
return COMMAND_RETURN_CLOSE;
client->bufferPos = client->bufferLength; client->bufferPos = client->bufferLength;
} }
if (client->bufferLength == CLIENT_MAX_BUFFER_LENGTH) { if (client->bufferLength == CLIENT_MAX_BUFFER_LENGTH) {