From:             wesleygoku at hotmail dot com
Operating system: Windows 2000 SP4 + Apache 2.0.49
PHP version:      4.3.6
PHP Bug Type:     Unknown/Other Function
Bug description:  Connection handling NEVER works well

Description:
------------
The funcions connection_aborted(), connection_status() and
register_shutdown_function never work well. Using an infinite while (while
(true)) to make my WebChat work, even the user stopping the page load, the
script keep running (even when I set ignore_user_abort(0)). When I tried
to check the connection with these functions, they always returnet TRUE,
or NORMAL, even the register_shutdown_function callback funcion ISN'T
called.

And every bug report of this problem says it was corrected (since 2002),
but I'm using it TODAY (with everything updated) and the problem
persists!

I'm using PHP 4.3.6 as an Apache 2.0.49 module.

Reproduce code:
---------------
set_time_limit(0);
ignore_user_abort(0);
register_shutdown_function("chat_quit");

function chat_quit () {
        // some code
        exit;
}

echo "<!-- "; for ($i = 0; $i < 20480; $i++) {echo rand(0, 9); } echo "
-->\n";
flush();

while (true) {
        // Infinite code
}

Expected result:
----------------
When the user hits 'stop', the function 'chat_quit' should be called. Even
if I change 'while (true)' to 'while (!connection_aborted())' the loop
continues.

Actual result:
--------------
The function is NEVER called.

-- 
Edit bug report at http://bugs.php.net/?id=28195&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28195&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28195&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28195&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28195&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28195&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28195&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28195&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28195&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28195&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28195&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28195&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28195&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28195&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28195&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28195&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28195&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28195&r=float

Reply via email to