libmicrohttpd

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

commit b26d68a71c1e001383d35bdfbc958d7caa2aedde
parent 1a46bfd6e0929e2004ffda318282cbf21d9f5299
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue,  8 Mar 2022 10:35:47 +0300

upgrade response: set response size to zero

Upgrade responses do not have body, so zero must be used as the body size.

Diffstat:
Msrc/microhttpd/connection.c | 2--
Msrc/microhttpd/response.c | 2+-
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -3968,8 +3968,6 @@ MHD_connection_handle_write (struct MHD_Connection *connection) (NULL != resp->crc) ); mhd_assert ( (0 == connection->response_write_position) || \ (resp->total_size == - connection->response_write_position) || \ - (MHD_SIZE_UNKNOWN == connection->response_write_position) ); mhd_assert ((MHD_CONN_MUST_UPGRADE != connection->keepalive) || \ (! connection->rp_props.send_reply_body)); diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c @@ -1942,7 +1942,7 @@ MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler, #endif response->upgrade_handler = upgrade_handler; response->upgrade_handler_cls = upgrade_handler_cls; - response->total_size = MHD_SIZE_UNKNOWN; + response->total_size = 0; response->reference_count = 1; if (MHD_NO == MHD_add_response_header (response,