commit 8a9bb841b8aa936072a0f52898de8433b3434f21
parent 86b478e347f4fdd4b8945724119bb753b27e84c8
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 26 Oct 2021 13:09:12 +0300
Chunked responses: do not provide extra space for the response if size is known
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -1150,7 +1150,7 @@ try_ready_chunked_body (struct MHD_Connection *connection,
if (MHD_SIZE_UNKNOWN == response->total_size)
left_to_send = MHD_SIZE_UNKNOWN;
else
- left_to_send = MHD_SIZE_UNKNOWN - connection->response_write_position;
+ left_to_send = response->total_size - connection->response_write_position;
size_to_fill = connection->write_buffer_size - max_chunk_overhead;
/* Limit size for the callback to the max usable size */