Bug #1881

max_keep_alive_requests could not depend on URI

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

Status:FixedStart date:2009-01-24
Priority:LowDue date:
Assignee:-% Done:

100%

Category:coreEstimated time:0.10 hour
Target version:1.4.23
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 Magnifier - moving the test after all config_patch_connection()s. (903 Bytes) roques, 2009-01-27 02:57

URI_conditinal-max_keep_alive_requests2.patch Magnifier - Move test to http_response_write_header() as in trunk. (1016 Bytes) roques, 2009-02-06 21:21

Associated revisions

Revision 2534
Added by stbuehler almost 5 years ago

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

History

#1 Updated by icy about 5 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 5 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 5 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 5 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 5 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 5 years ago

  • Target version changed from 1.4.22 to 1.4.23

#7 Updated by roques about 5 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 5 years ago

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

Applied in changeset r2534.

Also available in: Atom