summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2014-04-02 10:04:11 +0000
committerStefan Bühler <stbuehler@web.de>2014-04-02 10:04:11 +0000
commit3605a3bec31f5e1bc79fdfb830b84e188f060982 (patch)
tree89e04437c1364afa4c14b8675a229ad95177102b
parente1b1c52028b446fdef837d26341dd1431780e0f6 (diff)
downloadlighttpd-git-3605a3bec31f5e1bc79fdfb830b84e188f060982.tar.gz
use keep-alive timeout while waiting for HTTP headers; use always the read timeout while waiting for the HTTP body
From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2962 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--NEWS2
-rw-r--r--src/server.c20
2 files changed, 12 insertions, 10 deletions
diff --git a/NEWS b/NEWS
index b9bd48fc..e82b90b0 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ NEWS
====
- 1.4.36
- *
+ * use keep-alive timeout while waiting for HTTP headers; use always the read timeout while waiting for the HTTP body
- 1.4.35 - 2014-03-12
* [network/ssl] fix build error if TLSEXT is disabled
diff --git a/src/server.c b/src/server.c
index 56919219..d47fd625 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1296,23 +1296,25 @@ int main (int argc, char **argv) {
if (con->state == CON_STATE_READ ||
con->state == CON_STATE_READ_POST) {
- if (con->request_count == 1) {
+ if (con->request_count == 1 || con->state == CON_STATE_READ_POST) {
if (srv->cur_ts - con->read_idle_ts > con->conf.max_read_idle) {
/* time - out */
-#if 0
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "connection closed - read-timeout:", con->fd);
-#endif
+ if (con->conf.log_request_handling) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "connection closed - read timeout:", con->fd);
+ }
+
connection_set_state(srv, con, CON_STATE_ERROR);
changed = 1;
}
} else {
if (srv->cur_ts - con->read_idle_ts > con->keep_alive_idle) {
/* time - out */
-#if 0
- log_error_write(srv, __FILE__, __LINE__, "sd",
- "connection closed - read-timeout:", con->fd);
-#endif
+ if (con->conf.log_request_handling) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
+ "connection closed - keep-alive timeout:", con->fd);
+ }
+
connection_set_state(srv, con, CON_STATE_ERROR);
changed = 1;
}