[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
personal/stbuehler/fix-fdevent
Glenn Strauss 4 years ago
parent 96061c1e5e
commit 629b16f188
  1. 4
      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;
}

Loading…
Cancel
Save