|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-08-21 08:05 UTC] fdcxl at 163 dot com
Description:
------------
connection_status function can't reflect the right information. When I click Stop button of IE, I can't get the ABORT signal.
Reproduce code:
---------------
conn.php
<?php
while(true)
{
sleep(1);
file_put_contents("/tmp/abc", "Connection:".connection_status()."\n", FILE_APPEND);
}
?>
I access this page using IE with http, after about 10 seconds, I click Stop button of IE.
Expected result:
----------------
The contents of /tmp/abc should be a sequence of 0s with one 1 in the end. The script stops.
Actual result:
--------------
I get all 0s, and script keeps running
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 10:00:02 2025 UTC |
I make another test. With the following script: <?php $str = "asdfasdf5687ju9465870u985tg79yh8"; $str1 = str_repeat($str, 1000); $str2 = $str; function write() { file_put_contents("/tmp/abc", "Final Connection:".connection_status()."\n", FILE_APPEND); } register_shutdown_function("write"); while(1) { $count = 100000000; while($count > 0) { $count = $count -1; if($count%1000000==0) { var_dump($str1); //var_dump($str2); ob_flush(); } } } ?> If large mount of output is sent like $str1, I will get ABORT signal and script terminated. But if $str2 is sent, it seems that no ABORT signal and script keeps running to TIMEOUT