php with fastcgi does not detect user abort

Bug #193619 reported by Guillermo Pérez
2
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: php5-cgi

This is related with php bug: http://bugs.php.net/37256

When using php in fastcgi mode, it does not detect any user abort. connection_status() always return 0, even after user aborts connection.

I'm using hardy. It's supposed to be solved in PHP 5.2 since May 2006, but perhaps hardy package 5.2.3-1ubuntu6.2 does not include the fix.

You can use this script to test the problem:
<?
ignore_user_abort(true);

echo "hello";
flush();
sleep(10);
echo "bye"

$fp=fopen('/tmp/conection_log.txt','a');
fputs($fp,'Connection status is: '.connection_status()."\n");
fclose($fp);

If you press stop after loading the page (you will have time because the sleep 10), connection_status shouldn't be 0 at the end of the script.

Revision history for this message
Chuck Short (zulcss) wrote :

I have checked with upstream PHP cvs and the fix is indeed included in our version in Hardy. Ill open another bug with upstream.

Thanks
chuck

Changed in php5:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Guillermo Pérez (bisho) wrote :

If you need any other detail about the setup or something else just ask.

And you are going to open a new bug on the PHP buzilla or where? can you tell me the php bug id to follow up that bug too?

Thanks

Revision history for this message
Chuck Short (zulcss) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Not a bug according to upstream

Changed in php5:
status: Confirmed → Invalid
Revision history for this message
Guillermo Pérez (bisho) wrote :

Please, it IS a bug. They closed the bug wrongly:
-------------------------------
Script continues normally and abort IS ignored, this is of course the
intended functionality.

But the return of connection_status() is always 0, when it should be 1
(ABORTED) to indicate that the connection is closed because an abort.

See connection_status() documentation. The return of that function is
what is buggy here:
http://www.php.net/manual/en/features.connection-handling.php

Please, reopen this bug.

Revision history for this message
Guillermo Pérez (bisho) wrote :

Sorry, my fault.

I discussed this with the PHP developers and now I see it's not a bug. Sorry again for bothering here.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.