From 7f33ea76e7f7b912b70d4e226f376abb8e6cada8 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Mon, 23 Aug 2021 22:22:16 +0300 Subject: [PATCH] Stop shrinking memory buffer after preparing reply header or footers --- src/microhttpd/connection.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 89528031..4ebbf68f 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -1546,6 +1546,7 @@ connection_maximize_write_buffer (struct MHD_Connection *connection) } +#if 0 /* disable unused function */ /** * Shrink connection write buffer to the size of unsent data. * @@ -1578,6 +1579,9 @@ connection_shrink_write_buffer (struct MHD_Connection *connection) } +#endif /* unused function */ + + /** * Switch connection from recv mode to send mode. * @@ -2099,9 +2103,6 @@ build_header_response (struct MHD_Connection *connection) buf[pos++] = '\n'; c->write_buffer_append_offset = pos; - /* TODO: remove shrink of the buffer, - * handle maximized buffer in other functions */ - connection_shrink_write_buffer (c); return MHD_YES; } @@ -2170,8 +2171,6 @@ build_connection_chunked_response_footer (struct MHD_Connection *connection) c->write_buffer_append_offset += used_size; mhd_assert (c->write_buffer_append_offset <= c->write_buffer_size); - /* TODO: remove shrink */ - connection_shrink_write_buffer (c); return MHD_YES; }