php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37129 ignore_user_abort not working
Submitted: 2006-04-18 21:21 UTC Modified: 2006-04-18 22:36 UTC
From: devrjason at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.2 OS: Windows_NT
Private report: No CVE-ID: None
 [2006-04-18 21:21 UTC] devrjason at gmail dot com
Description:
------------
Looks like bug #17265 broke again, but I was unable to add a comment to it since it's closed. This code doesn't stop running when the page is aborted.

Reproduce code:
---------------
$mcon = mysql_connect("localhost", "root", "*****")
	or die("mysql connect failed");

while (1) {
	sleep(3);
	$status = connection_status();
	@mysql_query("insert into test.tests set charv='Connection status: $status'",$mcon);
	$status = connection_aborted();
	@mysql_query("insert into test.tests set charv='Connection aborted: $status'",$mcon);
}

Expected result:
----------------
No more entries after script is aborted.

Actual result:
--------------
Script continues making entries until it times out.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-18 21:24 UTC] tony2001@php.net
PHP knows that the connectio was aborted only if it tries to write something to the buffer and fails.
If you don't write anything to the buffer/screen - there is no way for PHP to know that.
 [2006-04-18 22:36 UTC] devrjason at gmail dot com
PHP generally runs on the same machine as the webserver is running. It knows the remote host, why can't it pole TCP connections and figure out when the remote host no longer exists in the list?

Perhaps that sounds a bit outlandish, but I find it quite ridiculous that web servers can't tell CGIs little important details like that, since the CGI runs on the same machine. Grrr...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 18:01:31 2024 UTC