libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 7f33ea76e7f7b912b70d4e226f376abb8e6cada8
parent 95d1725ce3f2deafa33f697f5cb54ab6c557d415
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Mon, 23 Aug 2021 22:22:16 +0300

Stop shrinking memory buffer after preparing reply header or footers

Diffstat:
Msrc/microhttpd/connection.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git 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; }