Ticket #1648 (closed defect: fixed)

Opened 4 months ago

Last modified 5 weeks ago

Lighty 1.5 drops headers for keep-alive sent from PHP

Reported by: Psih Owned by: jan
Priority: normal Milestone: 1.5.0
Component: core Version: 1.5.x-svn
Severity: normal Keywords: lighttpd 1.5 keep-alive
Cc: Blocked By:
Need User Feedback: no Blocking:

Description

I have a script witch shoudn't use keep alive (and other site parts should). As Lighttpd doesn't support conditional keep-alive (Also tested and confirmed by hoffie) I used PHP like this: Header('Connection: close'); That is what i get in reality (I used Firefox extension Live HTTP Headers):

GET /announce.php HTTP/1.1
Host: file.lv
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: uid=280883; __utma=263829531.1162435829.1201506950.1208258425.1208377469.46; pass=2f9bf6d23d01cac56dddd0ce68ad4d9d; __utmz=263829531.1201506950.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)

HTTP/1.x 200 OK
Content-Type: text/plain;charset=windows-1251
Pragma: no-cache
Content-Length: 45
Date: Sat, 19 Apr 2008 07:06:33 GMT

Attachments

Fix-server.max-keep-alive-requests-handling.patch (1.3 kB) - added by stbuehler 4 months ago.

Change History

Changed 4 months ago by Psih

  • keywords lighttpd 1.5 keep-alive added

Changed 4 months ago by darix

how about:

$HTTP["url"] =~ "^/announce\.php" {
  server.max-keep-alive-requests = 0
}

that should solve the problem for you.

Changed 4 months ago by Psih

It doesn't. Here is my config Lighttpd config

I tried both ways - inside $HTTPhost? == "file.lv" (commented one) and outside the block - it still send's back no Connection header

GET /announce.php HTTP/1.1
Host: file.lv
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: uid=280883; __utma=263829531.1162435829.1201506950.1208377469.1208596902.47; pass=2f9bf6d23d01cac56dddd0ce68ad4d9d; __utmz=263829531.1201506950.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); qwasz=1208596709; gadget_play=1208596709; PHPSESSID=bbf7bd5b96a7d4a1bf3b43730afd78a3; __utmb=263829531.5.10.1208596902484; __utmc=263829531
Cache-Control: max-age=0

HTTP/1.x 200 OK
Content-Type: text/plain;charset=windows-1251
Pragma: no-cache
Content-Length: 45
Date: Sat, 19 Apr 2008 09:24:49 GMT

Changed 4 months ago by Psih

Maybe we can discuss it on IRC right now - i'm online at this moment. This one was tested with someone of the developers (i don't remember who it was, i think hoffee - he confirmed conditionals are not working for keep-alive)

Changed 4 months ago by stbuehler

The Connection: header gets dropped by mod_proxy_core (it is used for the backend connection, so if a backend sends "Connection: close" the backend connections gets closed).

Perhaps we should change that behaviour for specific backens like fastcgi, or should add another header to give the backend control over the connection header, or add a config option, ...

The server.max-keep-alive-requests is broken in conditionals (it only works in some of them), see attached patch.

Changed 4 months ago by stbuehler

Changed 5 weeks ago by stbuehler

  • status changed from new to closed
  • resolution set to fixed

Fixed in [2233]

Add/Change #1648 (Lighty 1.5 drops headers for keep-alive sent from PHP)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.