Reply to Keep-Alive and Content-Length problem

Your name:

Reply:


Posted by Anze on 03/19/07 13:05

Hi!

I hope this is the right newsgroup for this problem - I have searched all
around the web and couldn't find the answer.

Short summary:
Apache + PHP on some servers return "Connection: Keep-Alive" header, but
without "Content-length: ..." header. Is this correct? How does client know
when the content ends?

Background:
I have a CMS which is (of course) locked by authentication. I'm using
PHPlib, which in turn uses PHP sessions. The whole system is well tested
over last 5 years or so and always worked flawlessly.
Lately there has been an occasional problem logging into the application.
The problem is server specific, but what is even weirder, it is also
browser-specific. For instance, I can always login without problems in
Konqueror, usually without problems in IE and... Firefox makes trouble.

Because of this I installed FF extension livehttpheaders and listened to
traffic between browser and server and compared it to a server where
everything worked. The only difference was Keep-Alive header:

GET /page.php HTTP/1.1
Host: www.domain.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2)
Gecko/20070208 Iceweasel/2.0.0.2 (Debian-2.0.0.2+dfsg-3)
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: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

HTTP/1.x 200 OK
Date: Mon, 19 Mar 2007 12:32:56 GMT
Server: Apache
Set-Cookie: PHPSESSID=bab0ea73140b093fa952396f22075a9c; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Keep-Alive: timeout=3, max=600
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-2

Then the client starts the next connection (for some image) and so on.

Now: there is Keep-Alive header, but no Content-Length. How does the browser
know when the content is finished?

Hope it makes sense... :)

Best,

Anze

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация