php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26604 No Keep-Alive with Apache2 module for HTTP/1.0
Submitted: 2003-12-12 11:08 UTC Modified: 2003-12-12 12:16 UTC
From: jenskord at gmx dot de Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4.3.4 OS:
Private report: No CVE-ID: None
 [2003-12-12 11:08 UTC] jenskord at gmx dot de
Description:
------------
With apache2 module apache2 always responds with "Connection: Close" for a HTTP/1.0 (but not for 1.1)request. Source of this appears to be the line:

apr_table_unset(r->headers_in, "Connection");

in (both) sapi_apache2.c. Omit this line. Apache2 decides on its own by the existence of the Content-Length: header in the result. HTTP/1.1 proofes it.

Reproduce code:
---------------
Send:
GET http://localhost/test/test.php HTTP/1.0
Connection: Keep-Alive


Expected result:
----------------
HTTP/1.1 200 OK
Date: Fri, 12 Dec 2003 15:42:46 GMT
Server: Apache/2.0.48
X-Powered-By: PHP/4.3.4
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Fri, 12 Dec 2003 15:42:47 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 4
Connection: Keep-Alive
Content-Type: text/plain; charset=ISO-8859-1

xxxx

Actual result:
--------------
HTTP/1.1 200 OK
Date: Fri, 12 Dec 2003 15:42:46 GMT
Server: Apache/2.0.48
X-Powered-By: PHP/4.3.4
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Fri, 12 Dec 2003 15:42:47 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 4
Connection: close
Content-Type: text/plain; charset=ISO-8859-1

xxxx

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-12 12:16 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC