Project

General

Profile

Actions

Bug #1881

closed

max_keep_alive_requests could not depend on URI

Added by roques almost 16 years ago. Updated over 15 years ago.

Status:
Fixed
Priority:
Low
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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().


Files

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
Actions #1

Updated by icy almost 16 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? :)

Actions #2

Updated by roques almost 16 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 :-)

Actions #3

Updated by icy almost 16 years ago

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

Updated by stbuehler almost 16 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)

Actions #5

Updated by roques almost 16 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().

Actions #6

Updated by stbuehler almost 16 years ago

  • Target version changed from 1.4.22 to 1.4.23
Actions #7

Updated by roques almost 16 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?

Actions #8

Updated by stbuehler over 15 years ago

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

Applied in changeset r2534.

Actions

Also available in: Atom