#17774 [Fbk-Opn]: connection_status() not returning correct result
ID: 17774 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: FREEBSD 4.5-STABLE PHP Version: 4.0CVS-2002-06-15 New Comment: Okay, I should report this to Apache then ? This is a fault in there software ? Previous Comments: [2002-12-08 03:17:06] [EMAIL PROTECTED] For me your test script makes output.txt contain 1 when I press 'stop' button in my browser. But I'm using Apache 1.3.27. And so should you as Apache2 is still beta quality. [2002-12-07 08:47:29] [EMAIL PROTECTED] Okay, time has moved on, plenty of new versions have come out, ive kept up to the very latest all along, alas, as expected, it still doesnt work. Can I just get a clarification of what should happen when a user presses the stop button on the following script ? My guess is that it should put a 1 or a 2 into the file, not a 0! - ? function exitfp() { $fp = fopen(/usr/home/neil/public_html/test/output.txt,a); fputs($fp, connection_status()); fclose($fp); } register_shutdown_function('exitfp'); if(connection_aborted() != true){print 0;} set_time_limit(0); ignore_user_abort(false); $m = '10'; while(connection_aborted() != true and $a != $m){ $c = 0; while($c != 4096){ print connection_status(); $c = $c + 1; $d = $d + 1; if($d == 128){ $d = 0; printbr; } flush(); } $a = $a + 1; sleep('5'); } exitfp(); ? --- You keep telling me this function is fixed, but surely the above code shuld have an output different to 0 if the user presses the stop button ? Heres some version info from my server FreeBSD admin.mghost.net 4.7-STABLE FreeBSD 4.7-STABLE #5: Sun Dec 1 00:39:59 GMT 2002 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/ADMIN i386 Apache/2.0.43 (Unix) PHP/4.3.0RC2 [2002-10-08 04:51:49] [EMAIL PROTECTED] Just to keep you informed on this, I have now deleted my old install of apache and installed a FRESH copy of apache 2.0.43 and the latest CVS at the time, im still using the same php.ini file. The problem still exists in its entirety. [2002-09-30 15:17:24] [EMAIL PROTECTED] Yes I am, however it didnt do this on the CVS install under a week ago, thats irrespective of my problem, Im not all that fussed wether it displays the zero or not, it really doesnt assist me in my long standing problem with the code I want to write that depends on the STOP buttong being pressed and detecting this. [2002-09-30 15:05:02] [EMAIL PROTECTED] Do you have output compression enabled, whether via PHP or via Apache (mod_gzip module for example) ? 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=17774edit=1
#17774 [Fbk-Opn]: connection_status() not returning correct result
ID: 17774 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: FREEBSD 4.5-STABLE PHP Version: 4.0CVS-2002-06-15 New Comment: Hmm, I probably look a bit thick rite now, but belive I had tried both values of ignore_user_abort, being set to false and true, but alwasy the same result, oops on my part for not realins to change it back to false, I did that and still the same result. I assume that you mean by output_buffers being set to on, is in teh php.ini ? Well This is a clipit of my php.ini ; a value for this directive (e.g., output_buffering=4096). output_buffering = Off I havnt changed my php.ini in all my installs [/usr/local/lib/php.ini] so that has been always set to Off. So anyway, ive tried with the ignore_user_abort(false); set and still it ignores the user abort and 50 seconds later produces a file that contains a '0'. I havnt changed anything since the last CVS a few days/weeks ago, yet it is no longer displaying a 0 in the browser it is just going with behaviour like it is buffering it, like you already suggested. Previous Comments: [2002-09-30 14:43:02] [EMAIL PROTECTED] If you did a clean install you have output buffering enabled, meaning that PHP won't send the browser data until it filled the buffer of 4k or the script has stopped running. This is why it does not output anything right away. The other 'problem' can be explain by the fact you likely have 'ignore_user_abort' enabled, meaning that the script will run till completion even if the user connection was terminated or timed out. [2002-09-30 14:33:47] [EMAIL PROTECTED] This is an old posting of the bug, it was back in the days when I was with rackshack and running freebsd 4.5-STABLE. I am now running freebsd 4.7-RELEASE 2 and amn with a different ISP, thus a totally different machine. From your very latest CVS, I just downloaded and installed 5 minutes ago this error is still occuring. In fact your latest version is even worse, now the script, which I will detail below doesnt print anything in the browser it just waits, and you press stop say after 5 seconds, approx 45 seconds later [thats a total of 50 1 second sleep attempts] the script writes to the outpout file the connection_status, which is a 0, this is saying that the script finsihed normally, this is WRONG according to your own manual of which it shgould report connection status 1, which is unatural termination of the script. This bug is not fixed, it cannot be me I have been through all flavours and rebuilds of freebsd and every time the same error! This is the script, still the same as it was before the latest cvs install that now doesnt display anything, you can view this script at http://admin.mghost.net/~neil/test/index.php, the output file is http://admin.mghost.net/~neil/test/wank.txt. ? function exitfp() { $fp = fopen(wank.txt,w); fputs($fp, connection_status()); fclose($fp); } register_shutdown_function('exitfp'); if(connection_aborted() != true){print 0;} flush(); ignore_user_abort(true); $m = '50'; while(connection_aborted() != true and $m $a){ sleep('1'); print connection_status(); flush(); $a = $a + 1; } exitfp(); ? [2002-09-29 22:47:09] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Using latest CVS snapshot I cannot replicate the problem you've described. According to http://www.php.net/manual/en/features.connection-handling.php 0 - NORMAL, and 0 is what gets printed to the browser. Upon untimely termination of script, 1 is written to the output file, which means that connection was aborted. [2002-09-25 12:40:54] [EMAIL PROTECTED] An ammendmant to my last two posts. I would expect the script to put a '1' into wank.txt if somebody presses the STOP button on there browser. However the output I am getting is a '0' to say it disconnected regulary. [2002-09-25 08:33:25] [EMAIL PROTECTED] Oh yeah, running that script, if I press the STOP button halfway through, after a
#17774 [Fbk-Opn]: connection_status() not returning correct result
ID: 17774 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: FREEBSD 4.5-STABLE PHP Version: 4.0CVS-2002-06-15 New Comment: Yes I am, however it didnt do this on the CVS install under a week ago, thats irrespective of my problem, Im not all that fussed wether it displays the zero or not, it really doesnt assist me in my long standing problem with the code I want to write that depends on the STOP buttong being pressed and detecting this. Previous Comments: [2002-09-30 15:05:02] [EMAIL PROTECTED] Do you have output compression enabled, whether via PHP or via Apache (mod_gzip module for example) ? [2002-09-30 15:00:28] [EMAIL PROTECTED] Hmm, I probably look a bit thick rite now, but belive I had tried both values of ignore_user_abort, being set to false and true, but alwasy the same result, oops on my part for not realins to change it back to false, I did that and still the same result. I assume that you mean by output_buffers being set to on, is in teh php.ini ? Well This is a clipit of my php.ini ; a value for this directive (e.g., output_buffering=4096). output_buffering = Off I havnt changed my php.ini in all my installs [/usr/local/lib/php.ini] so that has been always set to Off. So anyway, ive tried with the ignore_user_abort(false); set and still it ignores the user abort and 50 seconds later produces a file that contains a '0'. I havnt changed anything since the last CVS a few days/weeks ago, yet it is no longer displaying a 0 in the browser it is just going with behaviour like it is buffering it, like you already suggested. [2002-09-30 14:43:02] [EMAIL PROTECTED] If you did a clean install you have output buffering enabled, meaning that PHP won't send the browser data until it filled the buffer of 4k or the script has stopped running. This is why it does not output anything right away. The other 'problem' can be explain by the fact you likely have 'ignore_user_abort' enabled, meaning that the script will run till completion even if the user connection was terminated or timed out. [2002-09-30 14:33:47] [EMAIL PROTECTED] This is an old posting of the bug, it was back in the days when I was with rackshack and running freebsd 4.5-STABLE. I am now running freebsd 4.7-RELEASE 2 and amn with a different ISP, thus a totally different machine. From your very latest CVS, I just downloaded and installed 5 minutes ago this error is still occuring. In fact your latest version is even worse, now the script, which I will detail below doesnt print anything in the browser it just waits, and you press stop say after 5 seconds, approx 45 seconds later [thats a total of 50 1 second sleep attempts] the script writes to the outpout file the connection_status, which is a 0, this is saying that the script finsihed normally, this is WRONG according to your own manual of which it shgould report connection status 1, which is unatural termination of the script. This bug is not fixed, it cannot be me I have been through all flavours and rebuilds of freebsd and every time the same error! This is the script, still the same as it was before the latest cvs install that now doesnt display anything, you can view this script at http://admin.mghost.net/~neil/test/index.php, the output file is http://admin.mghost.net/~neil/test/wank.txt. ? function exitfp() { $fp = fopen(wank.txt,w); fputs($fp, connection_status()); fclose($fp); } register_shutdown_function('exitfp'); if(connection_aborted() != true){print 0;} flush(); ignore_user_abort(true); $m = '50'; while(connection_aborted() != true and $m $a){ sleep('1'); print connection_status(); flush(); $a = $a + 1; } exitfp(); ? [2002-09-29 22:47:09] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Using latest CVS snapshot I cannot replicate the problem you've described. According to http://www.php.net/manual/en/features.connection-handling.php 0 - NORMAL, and 0 is what gets printed to the