client: don't check FD_ISSET(client->fd) on expired client

client->fd becomes -1 when the client expires.  Don't use FD_ISSET()
with this expired client; doing so would cause a crash due to SIGBUS.
This commit is contained in:
Max Kellermann 2008-09-06 15:31:55 +02:00
parent 77b1671662
commit 6146d4f5bb

View File

@ -540,7 +540,8 @@ int client_manager_io(void)
}
client->lastTime = time(NULL);
}
if (FD_ISSET(client->fd, &wfds)) {
if (!client_is_expired(client) &&
FD_ISSET(client->fd, &wfds)) {
client_write_deferred(client);
client->lastTime = time(NULL);
}