libmicrohttpd

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

commit b0400609faa4c00d60a215f29ff3999ee95496f0
parent 45c7e2bc39a1620f2c853bd382175f874aa9f1bc
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Mon,  7 Jun 2021 21:29:15 +0300

keepalive_possible: do not use "Keep-Alive" with read-closed connections

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

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -1128,6 +1128,9 @@ keepalive_possible (struct MHD_Connection *connection) { if (MHD_CONN_MUST_CLOSE == connection->keepalive) return MHD_NO; + /* TODO: use additional flags, like "error_closure" */ + if (connection->read_closed) + return MHD_NO; if ( (NULL != connection->response) && (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) ) return MHD_NO;