Commit 9bac3065 authored by Helmut Grohne's avatar Helmut Grohne Committed by Helmut Grohne

connection_close.patch: cherry-picked from upstream

Fixes bad interaction with python-requests.
parent 8a867c8f
commit 629b16f188173b1d4d7434fc68fb85938b2fc582
Author: Glenn Strauss <gstrauss@gluelogic.com>
Date: Thu Jan 10 02:18:14 2019 -0500
[core] send Connection: close if reqbody not read (fixes #2924)
send Connection: close if it is known that request body has not finished
being read and will not finish being read
x-ref:
"Suboptimal keep-alive handling when request body is not read"
https://redmine.lighttpd.net/issues/2924
diff --git a/src/response.c b/src/response.c
index f6d910dd..09ab8d23 100644
--- a/src/response.c
+++ b/src/response.c
@@ -36,6 +36,10 @@ int http_response_write_header(server *srv, connection *con) {
/* disable keep-alive if requested */
if (con->request_count > con->conf.max_keep_alive_requests || 0 == con->conf.max_keep_alive_idle) {
con->keep_alive = 0;
+ } else if (0 != con->request.content_length
+ && con->request.content_length != con->request_content_queue->bytes_in
+ && (con->mode == DIRECT || 0 == con->conf.stream_request_body)) {
+ con->keep_alive = 0;
} else {
con->keep_alive_idle = con->conf.max_keep_alive_idle;
}
http_auth_backends_assertion.patch
connection_close.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment