Browse Source

Allow max-keep-alive-requests to depend on conditional (fixes #1881)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2534 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.23
Stefan Bühler 12 years ago
parent
commit
e2e7fe607a
  1. 1
      NEWS
  2. 11
      src/response.c

1
NEWS

@ -55,6 +55,7 @@ NEWS
* Ignore multiple "If-None-Match" headers (only use first one, fixes #753)
* Add X-Sendfile-Range feature (fixes #2005)
* Fix 100% cpu usage if time() < 0 (thx to gaspa and cate, fixes #1964)
* Allow max-keep-alive-requests to depend on conditional (fixes #1881)
- 1.4.22 - 2009-03-07
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)

11
src/response.c

@ -44,6 +44,11 @@ int http_response_write_header(server *srv, connection *con) {
buffer_append_string_len(b, CONST_STR_LEN(" "));
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) {
con->keep_alive = 0;
}
if (con->request.http_version != HTTP_VERSION_1_1 || con->keep_alive == 0) {
if (con->keep_alive) {
response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("keep-alive"));
@ -227,12 +232,6 @@ handler_t http_response_prepare(server *srv, connection *con) {
log_error_write(srv, __FILE__, __LINE__, "sb", "URI-query : ", con->uri.query);
}
/* disable keep-alive if requested */
if (con->request_count > con->conf.max_keep_alive_requests) {
con->keep_alive = 0;
}
/**
*

Loading…
Cancel
Save