#17774 [Com]: connection_status() not returning correct result

From: Date: Fri, 18 Apr 2003 19:55:19 +0000
Subject: #17774 [Com]: connection_status() not returning correct result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37864@lists.php.net to get a copy of this message
ID: 17774 Comment by: stank at stank dot stank Reported By: neil at mpfreescene dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: FREEBSD 4.7-STABLE PHP Version: PHP/4.3.0RC3 New Comment: Same problem here. If php can abort when the user aborts, why do you have to output to tell if the user has aborted? Previous Comments: ------------------------------------------------------------------------ [2003-02-02 11:52:48] blahstyle at hotmail dot com It's glad to meet the person who's suffering with same bug. I have two sample codes that isn't run correctly. First one: <? ignore_user_abort (true); set_time_limit (0); for($i = 1; $i < 100; $i++) { $fp = fopen("conntest.out", "wt"); fputs ($fp, $i.":".connection_aborted()."\n"); echo "\n"; flush (); fclose($fp); sleep(1); } ?> It's supposed to stop at xx:0 when user press STOP button of browser, but it isn't. The number is continued until 100. Second one: <?php function bye () { $fp = fopen ("./result.txt", "w"); fwrite ($fp, "BYE CALLED AT ".date("YmdHi",time())."\r\n"); fwrite ($fp, connection_aborted ()); fclose ($fp); die(); } register_shutdown_function ('bye'); set_time_limit ( 0 ); ignore_user_abort (true); $fp = fopen ("./result.txt", "w"); while (!connection_aborted()) { echo "\n"; flush (); sleep ( 1 ); } ?> Registered Shutdown function won't work! Neither of them worked correctly. Apache 1.3.27 + PHP 4.3.0, Win32 / FreeBSD 4.6 PHP is running as a dynamic module for Apache. ------------------------------------------------------------------------ [2002-12-13 04:05:31] neil at mpfreescene dot com ignore that, its working now, but it wasnt a minute ago. ------------------------------------------------------------------------ [2002-12-13 04:04:08] neil at mpfreescene dot com Okay, so we got the problem down to apache 2.x. ANyway, I got time to install apache 1.3.27. Now my system is running this :- SERVER_SOFTWARE Apache/1.3.27 (Unix) PHP/4.3.0RC3 And the problem still exists. I run the exact same script as shown above, which yourselfs have verified should return a '1'. The script is returning a 0, even if I press the STOP button. I have not bothered to compile gzip into this apache installation, to ensure it is not that which causes a problem. http://admin.mghost.net/~neil/test/ - script http://admin.mghost.net/~neil/test/output.txt - output file http://admin.mghost.net/~neil/test/test.cgi - standard perl diver script, to show details of my server. ------------------------------------------------------------------------ [2002-12-08 17:01:42] neil at mpfreescene dot com This may interest you :- http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8996 Obviously if apaches log files are doing htat, then its completely the fault of apache 2 :-/ ------------------------------------------------------------------------ [2002-12-08 10:46:28] sniper@php.net This report describes another problem: http://bugs.php.net/bug.php?id=14542 So there is clearly some bug in there. But for aborts it definately works (on apache1) so you should report this to apache folks too, would be nice to hear what they think of it.. :) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17774 -- Edit this bug report at http://bugs.php.net/?id=17774&edit=1

« previous php.bugs (#37864) next »