#27584 [Fbk->Opn]: flush sometimes don't work
| From: | xuefer at 21cn dot com | Date: | Sat, 13 Mar 2004 16:23:42 +0000 |
| Subject: | #27584 [Fbk->Opn]: flush sometimes don't work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56390@lists.php.net to get a copy of this message | ||
ID: 27584
User updated by: xuefer at 21cn dot com
Reported By: xuefer at 21cn dot com
-Status: Feedback
+Status: Open
Bug Type: Apache2 related
Operating System: *
PHP Version: 4.3.5RC3
New Comment:
tested with lastest build
without Rang:
Sun Mar 14 00:30:21 2004 GET /test.php HTTP/1.1
Sun Mar 14 00:30:21 2004 Host: 127.0.0.1
Sun Mar 14 00:30:21 2004 Accept: */*
Sun Mar 14 00:30:21 2004 User-Agent: Mozilla/4.0 (compatible; MSIE
5.00; Windows 98)
Sun Mar 14 00:30:21 2004 Pragma: no-cache
Sun Mar 14 00:30:21 2004 Cache-Control: no-cache
Sun Mar 14 00:30:21 2004 Connection: close
Sun Mar 14 00:30:21 2004 HTTP/1.1 200 OK
Sun Mar 14 00:30:21 2004 Date: Sat, 13 Mar 2004 16:30:21 GMT
Sun Mar 14 00:30:21 2004 Server: Apache/2.0.48 (Win32)
Sun Mar 14 00:30:21 2004 Connection: close
Sun Mar 14 00:30:21 2004 Transfer-Encoding: chunked
Sun Mar 14 00:30:21 2004 Content-Type: binary
with Rang:
Sun Mar 14 00:31:41 2004 GET /test.php HTTP/1.1
Sun Mar 14 00:31:41 2004 Host: 127.0.0.1
Sun Mar 14 00:31:41 2004 Accept: */*
Sun Mar 14 00:31:41 2004 User-Agent: Mozilla/4.0 (compatible; MSIE
5.00; Windows 98)
Sun Mar 14 00:31:41 2004 Range: bytes=839516-
Sun Mar 14 00:31:41 2004 Pragma: no-cache
Sun Mar 14 00:31:41 2004 Cache-Control: no-cache
Sun Mar 14 00:31:41 2004 Connection: close
Sun Mar 14 00:31:42 2004 HTTP/1.1 200 OK
Sun Mar 14 00:31:42 2004 Date: Sat, 13 Mar 2004 16:31:41 GMT
Sun Mar 14 00:31:42 2004 Server: Apache/2.0.48 (Win32)
Sun Mar 14 00:31:42 2004 Content-Range: bytes 839516-96413656/96413657
Sun Mar 14 00:31:42 2004 Content-Length: 95574141
Sun Mar 14 00:31:42 2004 Connection: close
Sun Mar 14 00:31:42 2004 Content-Type: binary
Previous Comments:
------------------------------------------------------------------------
[2004-03-13 04:56:27] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-03-12 21:45:17] xuefer at 21cn dot com
Description:
------------
it works under apache1, but not on apache2
this script is used for network-speed testing
yet, i don't know if it's relative to php or apache
Reproduce code:
---------------
<?php
header("Content-Type: binary");
// while (@ob_clean());
set_time_limit(5); // may be 1
$fp = fopen("/dev/urandom");
$u = fread($fp, 1024 * 1024); // 1mb
while (1) {
echo $u;
ob_flush(); flush();
}
?>
Expected result:
----------------
under apache1, each time request to this file will download start from
0% immediately
tested under IE & Flashget
Actual result:
--------------
but under apache2, 1st time seems ok, cancel IE download or stopped
flashget, then try again(with "Rang" header), download will not start
until script is timedout, then, start with a content-length in response
header
the process of apache2 is taking so much memory about XXmb even 1XXmb
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27584&edit=1