aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-06-07 21:29:15 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-06-08 09:54:39 +0300
commitb0400609faa4c00d60a215f29ff3999ee95496f0 (patch)
tree4302fb4b8c06dff9f40a001af35b28382e124685
parent45c7e2bc39a1620f2c853bd382175f874aa9f1bc (diff)
downloadlibmicrohttpd-b0400609faa4c00d60a215f29ff3999ee95496f0.tar.gz
libmicrohttpd-b0400609faa4c00d60a215f29ff3999ee95496f0.zip
keepalive_possible: do not use "Keep-Alive" with read-closed connections
-rw-r--r--src/microhttpd/connection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 0d7ba27b..cf22f41b 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1128,6 +1128,9 @@ keepalive_possible (struct MHD_Connection *connection)
1128{ 1128{
1129 if (MHD_CONN_MUST_CLOSE == connection->keepalive) 1129 if (MHD_CONN_MUST_CLOSE == connection->keepalive)
1130 return MHD_NO; 1130 return MHD_NO;
1131 /* TODO: use additional flags, like "error_closure" */
1132 if (connection->read_closed)
1133 return MHD_NO;
1131 if ( (NULL != connection->response) && 1134 if ( (NULL != connection->response) &&
1132 (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) ) 1135 (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) )
1133 return MHD_NO; 1136 return MHD_NO;