Project

General

Profile

Bug #1881

max_keep_alive_requests could not depend on URI

Added by roques about 10 years ago. Updated almost 10 years ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
core
Target version:
Start date:
2009-01-24
Due date:
% Done:

100%

Estimated time:
0.10 h
Missing in 1.5.x:

Description

In lighttpd upto and including 1.4.20 the following would not work as intended:

$HTTP["host"] == "update.example.com" {
        $HTTP["url"] =~ "\.chk$" {
                # close keep-alive connection after *.chk
                # The order of requests is *.ver, *.chk
                # client will not issue any more requests.
                server.max-keep-alive-requests = 0
        }
}

The attached patch makes it possible for server.max-keep-alice-requests to depend on $HTTP["url"] by moving the test if (con->request_count > con->conf.max_keep_alive_requests) after the last call to config_patch_connection().

URI_conditinal-max_keep_alive_requests.patch (903 Bytes) URI_conditinal-max_keep_alive_requests.patch moving the test after all config_patch_connection()s. roques, 2009-01-27 02:57
URI_conditinal-max_keep_alive_requests2.patch (1016 Bytes) URI_conditinal-max_keep_alive_requests2.patch Move test to http_response_write_header() as in trunk. roques, 2009-02-06 21:21

Associated revisions

Revision 2534 (diff)
Added by stbuehler almost 10 years ago

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

Revision e2e7fe60 (diff)
Added by stbuehler almost 10 years ago

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

History

#1

Updated by icy about 10 years ago

  • Target version changed from 1.4.20 to 1.4.21
  • % Done changed from 100 to 0
  • Patch available changed from Yes to No

Hm there is no patch attached. Maybe you forgot that? :)

#2

Updated by roques about 10 years ago

This is really strange. I'm sure I [Browse...]ed for the patch.
But, obviously something went amiss.
Let's see if I'm able to attach the patch this time :-)

#3

Updated by icy about 10 years ago

  • Target version changed from 1.4.21 to 1.4.22
  • Patch available changed from No to Yes
#4

Updated by stbuehler about 10 years ago

  • Status changed from New to Need Feedback
  • Patch available changed from Yes to No

The patch doesn't convince me; if the raw_url handler triggers, your patch skips the server.max-keep-alive-requests handling.

Perhaps we could check it again after the url conditional matching; in that case you could drop the value in an url conditional (i do not want to reactivate keep-alive after it got disabled)

#5

Updated by roques about 10 years ago

Moving the test down to the last possible moment should be another solution. (see attached patch)
In trunk the test has been moved into http_response_write_header() which should be OK.
I grepped for read-accesses to con->keep_alive and could not find any between the current location of the test and http_response_write_header().

#6

Updated by stbuehler about 10 years ago

  • Target version changed from 1.4.22 to 1.4.23
#7

Updated by roques about 10 years ago

  • Status changed from Need Feedback to Patch Pending
  • % Done changed from 0 to 70

The (revised on 2009-02-06) patch still applies cleanly to what is currently in subversion lighttpd-1.4.x/
Are there any problems or reserves against this solution?

#8

Updated by stbuehler almost 10 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 70 to 100

Applied in changeset r2534.

Also available in: Atom