summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2009-10-19 13:26:01 +0000
committerStefan Bühler <stbuehler@web.de>2009-10-19 13:26:01 +0000
commit932b67bd2b2d5c73266a7f13374e82f64752c862 (patch)
tree3ee69f70f4391d1c517f7d63b4ef0710a3819158
parenta0dfe15e4179ff469181deab802b32c4b1cb0eaf (diff)
downloadlighttpd-git-932b67bd2b2d5c73266a7f13374e82f64752c862.tar.gz
Fix linger close timeout handling, drop timeout to 5 seconds (fixes #2086)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2669 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--NEWS1
-rw-r--r--src/server.c5
-rw-r--r--src/settings.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 77186001..6836deed 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,7 @@ NEWS
* mod_accesslog: escape special characters (fixes #1551, thx icy)
* fix mod_webdav crash from #1793 (fixes #2084, thx hiroya)
* Don't print ssl error if client didn't support TLS SNI
+ * Fix linger close timeout handling, drop timeout to 5 seconds (fixes #2086)
- 1.4.23 - 2009-06-19
* Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
diff --git a/src/server.c b/src/server.c
index 2b83ede8..1bedd005 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1291,6 +1291,11 @@ int main (int argc, char **argv) {
changed = 1;
}
}
+
+ if (con->state == CON_STATE_CLOSE && (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT)) {
+ changed = 1;
+ }
+
/* we don't like div by zero */
if (0 == (t_diff = srv->cur_ts - con->connection_start)) t_diff = 1;
diff --git a/src/settings.h b/src/settings.h
index 19bfff44..6ee44b69 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -40,7 +40,7 @@ typedef enum { HANDLER_UNSET,
HANDLER_WAIT_FOR_FD
} handler_t;
-#define HTTP_LINGER_TIMEOUT 30
+#define HTTP_LINGER_TIMEOUT 5
/* we use it in a enum */
#ifdef TRUE