|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38532 connection status does not reflect the right information
Submitted: 2006-08-21 08:05 UTC Modified: 2006-08-21 09:58 UTC
From: fdcxl at 163 dot com Assigned:
Status: Not a bug Package: *Web Server problem
PHP Version: 5.1.5 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: fdcxl at 163 dot com
New email:
PHP Version: OS:


 [2006-08-21 08:05 UTC] fdcxl at 163 dot com
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:
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-21 08:46 UTC]
connection_status and connection_aborted() rely on the function that outputs the data from the buffer.
Since you do not output any data, there is no way to detect that the connection is dead.
 [2006-08-21 09:28 UTC] fdcxl at 163 dot com
In the manual, it says that when user clicks STOP button, the script should be terminated. In fact, the script keeps running. I checked it by verifying the size of /tmp/abc, which keeps increasing. 

I have tried to send output. It seems that IE maintains its own buffer, that any output can't get displayed before I click STOP button
 [2006-08-21 09:58 UTC] fdcxl at 163 dot com
I make another test. With the following script:
$str = "asdfasdf5687ju9465870u985tg79yh8";
$str1 = str_repeat($str, 1000);
$str2 = $str;
function write()
file_put_contents("/tmp/abc", "Final Connection:".connection_status()."\n", FILE_APPEND);
	$count = 100000000;
	while($count > 0)
	$count = $count -1;

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
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 18:01:28 2024 UTC