summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-02-10 22:15:59 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2019-02-10 22:15:59 -0500
commit74b18c385c079fc7888e413a67e7ce43e803ebae (patch)
tree1b33eb43ad1acbca13b21651d3d65da3eaafba10
parent9948537721a5d50bd3ab6b1fd072522173d9f530 (diff)
downloadlighttpd1.4-74b18c385c079fc7888e413a67e7ce43e803ebae.tar.gz
lighttpd1.4-74b18c385c079fc7888e413a67e7ce43e803ebae.zip
[core] no keep-alive if POLLRDHUP,empty read queue
send Connection: close if POLLRDHUP received and read queue is empty
-rw-r--r--src/connections.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/connections.c b/src/connections.c
index 1c33ca1f..b5d27fb0 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -911,7 +911,7 @@ static handler_t connection_handle_fdevent(server *srv, void *context, int reven
con->conf.stream_request_body &= ~(FDEVENT_STREAM_REQUEST_BUFMIN|FDEVENT_STREAM_REQUEST_POLLIN);
con->conf.stream_request_body |= FDEVENT_STREAM_REQUEST_POLLRDHUP;
con->is_readable = 1; /*(can read 0 for end-of-stream)*/
- con->keep_alive = 0;
+ if (chunkqueue_is_empty(con->read_queue)) con->keep_alive = 0;
if (con->request.content_length < -1) { /*(transparent proxy mode; no more data to read)*/
con->request.content_length = con->request_content_queue->bytes_in;
}