libmicrohttpd

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

commit 3fa1d302d22fb1e3553a057039054f515386e59d
parent f30afba9864b129072424c0f05472d9abb05fc50
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 17 Aug 2021 21:32:29 +0300

Fixed: always close connection if "close" was requested by client

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

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -1182,6 +1182,11 @@ keepalive_possible (struct MHD_Connection *connection) if (! MHD_IS_HTTP_VER_SUPPORTED (connection->http_ver)) return MHD_NO; + if (MHD_lookup_header_s_token_ci (connection, + MHD_HTTP_HEADER_CONNECTION, + "close")) + return MHD_NO; + if (MHD_IS_HTTP_VER_1_1_COMPAT (connection->http_ver) && ( (NULL == connection->response) || (0 == (connection->response->flags @@ -1192,11 +1197,6 @@ keepalive_possible (struct MHD_Connection *connection) "upgrade")) return MHD_NO; - if (MHD_lookup_header_s_token_ci (connection, - MHD_HTTP_HEADER_CONNECTION, - "close")) - return MHD_NO; - return MHD_YES; } if (MHD_HTTP_VER_1_0 == connection->http_ver)