mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
. In poll_send_{header,reply}(), don't bother deallocating stuff that
free_connection will deallocate anyway.
This commit is contained in:
parent
2080b05d4c
commit
a07492c1a8
@ -1575,9 +1575,6 @@ static void poll_send_header(struct connection *conn)
|
|||||||
/* check if we're done sending */
|
/* check if we're done sending */
|
||||||
if (conn->header_sent == conn->header_length)
|
if (conn->header_sent == conn->header_length)
|
||||||
{
|
{
|
||||||
if (!conn->header_dont_free) free(conn->header);
|
|
||||||
conn->header = NULL;
|
|
||||||
|
|
||||||
if (conn->header_only)
|
if (conn->header_only)
|
||||||
conn->state = DONE;
|
conn->state = DONE;
|
||||||
else
|
else
|
||||||
@ -1651,20 +1648,7 @@ static void poll_send_reply(struct connection *conn)
|
|||||||
conn->total_sent += (unsigned int)sent;
|
conn->total_sent += (unsigned int)sent;
|
||||||
|
|
||||||
/* check if we're done sending */
|
/* check if we're done sending */
|
||||||
if (conn->reply_sent == conn->reply_length)
|
if (conn->reply_sent == conn->reply_length) conn->state = DONE;
|
||||||
{
|
|
||||||
if (!conn->reply_dont_free && conn->reply != NULL)
|
|
||||||
{
|
|
||||||
free(conn->reply);
|
|
||||||
conn->reply = NULL;
|
|
||||||
}
|
|
||||||
if (conn->reply_file != NULL)
|
|
||||||
{
|
|
||||||
fclose(conn->reply_file);
|
|
||||||
conn->reply_file = NULL;
|
|
||||||
}
|
|
||||||
conn->state = DONE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user