don't free client resources except in client_close()
All of the client's resources are freed in client_close(). It is enough to set the "expired" flag, no need to duplicate lots of destruction code again and again.
This commit is contained in:
15
src/client.c
15
src/client.c
@@ -670,14 +670,6 @@ static void client_write_deferred(struct client *client)
|
|||||||
/* cause client to close */
|
/* cause client to close */
|
||||||
DEBUG("client %i: problems flushing buffer\n",
|
DEBUG("client %i: problems flushing buffer\n",
|
||||||
client->num);
|
client->num);
|
||||||
buf = client->deferred_send;
|
|
||||||
do {
|
|
||||||
struct sllnode *prev = buf;
|
|
||||||
buf = buf->next;
|
|
||||||
free(prev);
|
|
||||||
} while (buf);
|
|
||||||
client->deferred_send = NULL;
|
|
||||||
client->deferred_bytes = 0;
|
|
||||||
client->expired = 1;
|
client->expired = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -747,13 +739,6 @@ static void client_write_output(struct client *client)
|
|||||||
(unsigned long)client_max_output_buffer_size);
|
(unsigned long)client_max_output_buffer_size);
|
||||||
/* cause client to close */
|
/* cause client to close */
|
||||||
client->expired = 1;
|
client->expired = 1;
|
||||||
do {
|
|
||||||
struct sllnode *prev = buf;
|
|
||||||
buf = buf->next;
|
|
||||||
free(prev);
|
|
||||||
} while (buf);
|
|
||||||
client->deferred_send = NULL;
|
|
||||||
client->deferred_bytes = 0;
|
|
||||||
} else {
|
} else {
|
||||||
while (buf->next)
|
while (buf->next)
|
||||||
buf = buf->next;
|
buf = buf->next;
|
||||||
|
Reference in New Issue
Block a user