summaryrefslogtreecommitdiff
path: root/src/response.c
diff options
context:
space:
mode:
authorArno Töll <arno@debian.org>2012-11-21 23:03:54 +0100
committerArno Töll <arno@debian.org>2012-11-21 23:03:54 +0100
commit6b6dce9b02fdb1b840047562ad19f2c28080b46a (patch)
treecb8ce10661527fcd0c69652c39bdf883d26f7555 /src/response.c
parent8bc3f8767c4f4f4687d085405db60df79686521d (diff)
downloadlighttpd-6b6dce9b02fdb1b840047562ad19f2c28080b46a.tar.gz
Imported Upstream version 1.4.24upstream/1.4.24
Diffstat (limited to 'src/response.c')
-rw-r--r--src/response.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/response.c b/src/response.c
index ae9aeff..df543a5 100644
--- a/src/response.c
+++ b/src/response.c
@@ -1,3 +1,14 @@
+#include "response.h"
+#include "keyvalue.h"
+#include "log.h"
+#include "stat_cache.h"
+#include "chunk.h"
+
+#include "configfile.h"
+#include "connections.h"
+
+#include "plugin.h"
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -13,17 +24,6 @@
#include <stdio.h>
-#include "response.h"
-#include "keyvalue.h"
-#include "log.h"
-#include "stat_cache.h"
-#include "chunk.h"
-
-#include "configfile.h"
-#include "connections.h"
-
-#include "plugin.h"
-
#include "sys-socket.h"
#include "version.h"
@@ -45,8 +45,10 @@ int http_response_write_header(server *srv, connection *con) {
buffer_append_string(b, get_http_status_name(con->http_status));
/* disable keep-alive if requested */
- if (con->request_count > con->conf.max_keep_alive_requests) {
+ if (con->request_count > con->conf.max_keep_alive_requests || 0 == con->conf.max_keep_alive_idle) {
con->keep_alive = 0;
+ } else {
+ con->keep_alive_idle = con->conf.max_keep_alive_idle;
}
if (con->request.http_version != HTTP_VERSION_1_1 || con->keep_alive == 0) {
@@ -70,7 +72,7 @@ int http_response_write_header(server *srv, connection *con) {
if (ds->value->used && ds->key->used &&
0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-LIGHTTPD-")) &&
- 0 != strcasecmp(ds->key->ptr, "X-Sendfile")) {
+ 0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-Sendfile"))) {
if (0 == strcasecmp(ds->key->ptr, "Date")) have_date = 1;
if (0 == strcasecmp(ds->key->ptr, "Server")) have_server = 1;
if (0 == strcasecmp(ds->key->ptr, "Content-Encoding") && 304 == con->http_status) continue;