#41672 [NEW]: connection_status/connection_abort issue

From: Date: Tue, 12 Jun 2007 19:58:42 +0000
Subject: #41672 [NEW]: connection_status/connection_abort issue
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113715@lists.php.net to get a copy of this message
From: mfshop at comcast dot net Operating system: Windows 2003 Server PHP version: 4CVS-2007-06-12 (snap) PHP Bug Type: Unknown/Other Function Bug description: connection_status/connection_abort issue Description: ------------ Running IIS6 on Windows 2003 Server and the latest PHP 4.4.8-dev from snaps.php.net. The problem also exists on PHP 4.4.7. Running as an ISAPI module. connection_status() and connection_abort() always return 0. Setting ignore_user_abort(true) or ignore_user_abort(false) also seems to have no effect. In the example script below, changing ignore_user_abort(true) to ignore_user_abort(false) produces the exact same results. This seems to be similar or the same as Bug #30301 but for a PHP 4 instead (also that bug report seems to have been ignored/closed due to no feedback status). Reproduce code: --------------- function script_end() { global $fd; $clientstate = connection_aborted(); $clientstate2 = connection_status(); fwrite($fd, "Final: $clientstate, $clientstate2\n"); fclose($fd); exit(); } $fd=fopen("test.txt", "w"); // Change filename/dir to somewhere where the IIS User has proper permissions as necessary. register_shutdown_function("script_end"); ignore_user_abort(true); for ($i=0; $i<20; $i++) { echo "$i<br>\n"; Flush(); $clientstate = connection_aborted(); $clientstate2 = connection_status(); fwrite($fd, "$i: $clientstate, $clientstate2\n"); sleep(1); } Expected result: ---------------- Start loading the page and then hit the stop button before it finishes. Look at the test.txt afterwards. We expect to see the values returned by connection_aborted() and connection_status() to change/be something other than 0 or, depending on how ignore_user_abort() is set, we may expect to see the count not reach 20 (i.e. the script detecting user abort and terminating the script). Actual result: -------------- The test.txt file will always end up looking like so: 0: 0, 0 1: 0, 0 2: 0, 0 3: 0, 0 4: 0, 0 5: 0, 0 6: 0, 0 7: 0, 0 8: 0, 0 9: 0, 0 10: 0, 0 11: 0, 0 12: 0, 0 13: 0, 0 14: 0, 0 15: 0, 0 16: 0, 0 17: 0, 0 18: 0, 0 19: 0, 0 Final: 0, 0 -- Edit bug report at http://bugs.php.net/?id=41672&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41672&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41672&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41672&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41672&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41672&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41672&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41672&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41672&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41672&r=support Expected behavior: http://bugs.php.net/fix.php?id=41672&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41672&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41672&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41672&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41672&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41672&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41672&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41672&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41672&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41672&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41672&r=mysqlcfg

« previous php.bugs (#113715) next »