aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-10-26 13:09:12 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-10-26 13:09:12 +0300
commit8a9bb841b8aa936072a0f52898de8433b3434f21 (patch)
tree9f2aaa75db5b3242bcbc8130b76479da47b4b928
parent86b478e347f4fdd4b8945724119bb753b27e84c8 (diff)
downloadlibmicrohttpd-8a9bb841b8aa936072a0f52898de8433b3434f21.tar.gz
libmicrohttpd-8a9bb841b8aa936072a0f52898de8433b3434f21.zip
Chunked responses: do not provide extra space for the response if size is known
-rw-r--r--src/microhttpd/connection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index d7374b5a..c23e9e5c 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1150,7 +1150,7 @@ try_ready_chunked_body (struct MHD_Connection *connection,
1150 if (MHD_SIZE_UNKNOWN == response->total_size) 1150 if (MHD_SIZE_UNKNOWN == response->total_size)
1151 left_to_send = MHD_SIZE_UNKNOWN; 1151 left_to_send = MHD_SIZE_UNKNOWN;
1152 else 1152 else
1153 left_to_send = MHD_SIZE_UNKNOWN - connection->response_write_position; 1153 left_to_send = response->total_size - connection->response_write_position;
1154 1154
1155 size_to_fill = connection->write_buffer_size - max_chunk_overhead; 1155 size_to_fill = connection->write_buffer_size - max_chunk_overhead;
1156 /* Limit size for the callback to the max usable size */ 1156 /* Limit size for the callback to the max usable size */