|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[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
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
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