php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23163 connection_aborted() doesn't work
Submitted: 2003-04-11 04:31 UTC Modified: 2003-04-28 11:17 UTC
Votes:8
Avg. Score:4.6 ± 1.0
Reproduced:7 of 7 (100.0%)
Same Version:2 (28.6%)
Same OS:3 (42.9%)
From: lapo at lapo dot it Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.3.2RC1 OS: Windows 2000
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lapo at lapo dot it
New email:
PHP Version: OS:

 

 [2003-04-11 04:31 UTC] lapo at lapo dot it
I have a long running script with the following "core"

set_time_limit(60000);
ignore_user_abort(true); // also tried without
ob_implicit_flush();
$query = mssql_query('SELECT lotsarows') or die('Error.');
while($row = mssql_fetch_array($query)) {
    //do things
    mssql_query('UPDATE onerow') or die('Error.');
    //do things
    flush();
    if(connection_aborted())
	die();
}

But it seems to not stop on user abort.
(I can see the DB is being updated after pressing STOP in the browser)

Using Apache2.0 on Win32 (Win2000) and PHP-4.3.2-RC1
This seems similiar to #2929 but doesn't depend on flush() presence...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-28 11:17 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-07-16 03:35 UTC] jeff at deluxeportal dot com
I'm having the same problem with PHP 4.3.2 and 4.3.3RC1 as well as the latest PHP5 snapshot in Windows XP and Windows 2003 Server.
 [2003-08-24 17:09 UTC] dennis at conversis dot de
I encounter the same problem with php-4.3.2 and 4.3.3rc4. Effectively the connection_* function are broken and I can no longer determine when the user has aborted the script.

I made an interesting and somewhat weird observation though:
If I use the print or echo command in the while-loop once (!) then the script will terminate after the loop has run *exactly* three times after the abort.

If I put more than one print/echo in the loop (2->inf) then the script will terminate after *exactly* 2 (!) iterations of the loop after the script has aborted.

The length of the string used in the print/echo statement doesn't seem to matter.

I hope this helps as this bug is currently a showstopper for the stuff I'm developing (a PHP Jabber client).
 [2003-08-24 17:14 UTC] dennis at conversis dot de
Sorry, forgot to mention my config:
I'm running Red Hat 7.3 with the standard apache-1.3.27-2 package and a self-compiled php-4.3.3rc4 (php-4.3.2 didn't work either).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 12:01:26 2024 UTC