php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64240 Output Buffering does not work with Connection Handling
Submitted: 2013-02-18 21:08 UTC Modified: 2013-07-30 19:20 UTC
From: nathanb@php.net Assigned: mike (profile)
Status: Not a bug Package: Output Control
PHP Version: 5.4.11 OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nathanb@php.net
New email:
PHP Version: OS:

 

 [2013-02-18 21:08 UTC] nathanb@php.net
Description:
------------
While an output buffer is in place the functions connection_aborted() and 
connection_status() will not return proper information. (I have only tested in 
apache2)

INSTRUCTIONS ON TEST SCRIPT:
In a terminal run "tail -f /tmp/test.tmp" put script in www accessible directory, 
run the script from a browser and within a second or two stop the connection or 
close browser. Watch the terminal for actions to take place. (comment out the 
ob_start() function to see how it should react)

Test script:
---------------
<?php
ignore_user_abort(true);
ob_flush();
flush();
// Comment this out to see it work properly
ob_start(function ($data, $mode){
	return $data;
}, 1);

$i=0;
for($i=0;$i++<200;){
	echo "----";
	ob_flush();
	flush();
	if(connection_aborted()){
		file_put_contents('/tmp/test.tmp', sprintf("Conn Closed\nLoop itterations: %s\n\n", $i), FILE_APPEND);
		exit;
	}
	usleep(50000);
}
file_put_contents('/tmp/test.tmp', "Timeout\n\n", FILE_APPEND);
?>

Expected result:
----------------
Conn Closed
Loop itterations: %i



Actual result:
--------------
Timeout



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-30 19:20 UTC] mike@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: mike
 [2013-07-30 19:20 UTC] mike@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 19:01:31 2024 UTC