Remember keep-alive-idle in separate variable (fixes #1988)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2622 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.24
Stefan Bühler 14 years ago
parent 6c75b7bf24
commit d69683ddb5

@ -364,7 +364,8 @@ typedef struct {
int is_readable;
int is_writable;
int keep_alive; /* only request.c can enable it, all other just disable */
int keep_alive; /* only request.c can enable it, all other just disable */
int keep_alive_idle; /* remember max_keep_alive_idle from config */
int file_started;
int file_finished;

@ -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) {

@ -1253,7 +1253,7 @@ int main (int argc, char **argv) {
changed = 1;
}
} else {
if (srv->cur_ts - con->read_idle_ts > con->conf.max_keep_alive_idle) {
if (srv->cur_ts - con->read_idle_ts > con->keep_alive_idle) {
/* time - out */
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd",

Loading…
Cancel
Save