ID:               24177
 Comment by:       davisneilp at mindspring dot com
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Apache2 related
 Operating System: Linux
 PHP Version:      4.3.2
 New Comment:

When sending a 304, IIS/PHP 4.2.2 CGI exhibits the same general
behaviour. I send a 304, the header output ends up looking like:
wget -S www.somesite.com --header "If-None-Match: -285747861"
--20:24:17--  http://www.somesite.com/
           => `index.html.26'
Resolving www.somesite.com... done.
Connecting to www.somesite.com[209.251.47.108]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Server: Microsoft-IIS/4.0
 3 Date: Thu, 26 Jun 2003 21:59:42 GMT
 4 HTTP/1.1 304 Not changed
 5 X-Powered-By: PHP/4.2.2
 6 Last-Modified: Thu, 26 Jun 2003 21:58:56 GMT
 7 Content-Length: 0
 8 Content-type: text/html

Any idea how to kill the 200? I trained my script to not send any
output, and return a null as the page content. This works on
Apache/Linux/PHP 4.3.2

The 4.2.2 PHP CGI is on a production server and they are very difficult
to get updated in my company. This would be a compelling reason,
provided the update worked to resolve this.

thx,
Neil


Previous Comments:
------------------------------------------------------------------------

[2003-06-15 10:20:54] [EMAIL PROTECTED]

Yes. Odd at first.

After some experimentation I figured it out.

do-download.inc calls flush() on line 31. This causes the 'original'
status to be sent instead of the one specified by the call to
header().

If 4096 bytes or more are written before the flush the correct status
is sent.

I guess the codepath that handles an expicit flush manages to loose the
new status code somewhere.

I replaced echo " " with echo str_repeat(' ', 4096) and now our mirror
works fine and dandy again.

------------------------------------------------------------------------

[2003-06-13 15:19:17] [EMAIL PROTECTED]

# lynx -dump -head http://se.php.net/imap
HTTP/1.1 200 OK
Date: Fri, 13 Jun 2003 19:17:17 GMT
Server: Apache/2.0.46 (Unix) mod_ssl/2.0.46 OpenSSL/0.9.6b PHP/4.3.2
X-Powered-By: PHP/4.3.2
Content-language: en
Set-Cookie: COUNTRY=FIN%2C213.243.181.8; expires=Fri, 20-Jun-2003
19:17:17 GMT;
 path=/; domain=.php.net
Status: 200 OK
Last-Modified: Fri, 13 Jun 2003 19:09:38 GMT
Vary: Cookie
Connection: close
Content-Type: text/html;charset=ISO-8859-1

That works just fine?


------------------------------------------------------------------------

[2003-06-13 13:42:09] [EMAIL PROTECTED]

Description:
------------
Using Apache 2.0.46 and PHP 4.3.2 compiled with --with-apxs2

When a PHP page is used as an ErrorDocument page, calling any variation
of header() to replace the status code doesn't work. The client always
receive 404.

For example, try downloading from se.php.net:
http://se.php.net/get/php-4.3.2.tar.gz/from/this/mirror

You'll se that a Location header has been added (by the call to
header() in /include/do-download.inc) but the status returned is still
404, not 302 as expected.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24177&edit=1

Reply via email to