Bug #17774: connection_status() not returning correct result

From: Date: Sat, 15 Jun 2002 20:37:12 +0000
Subject: Bug #17774: connection_status() not returning correct result
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10511@lists.php.net to get a copy of this message
From: neil@mpfreescene.com Operating system: FREEBSD 4.5-STABLE PHP version: 4.0CVS-2002-06-15 PHP Bug Type: Sockets related Bug description: connection_status() not returning correct result Im runnig PHP 4.3.0CVS on Apache 2.x My problem is that I have written a script that sends content-dispostion headers to the browser and starts a download. When they user cancels the downloads, connection_status() is not reflecting this. I would assume that it shuold return a value of 1, USER ABORTED. Instead the script continues to run in the background by sending the file somewhere (limbo?). The script then reaches the end and terminates normally. After the script has terminated normally the value for connection_status() is still set at 0 NORMAL. Ive registered a shutdown function and tried all different methods like connection_aborted() which is FALSE, ive set ignore_user_abort() to TRUE and FALSE, but still alwasy the same result. A problem arrises that it is entering false information to my weblogs, i.e. its saying that the entire file was transferred when indeed it was canceled half way through. Im reading the file with fread() in 1K chunks and flushing in between, so as the script does not buffer everything and terminate prematurly, this is verified by the dump I have constructed at the end of the script to tell me what connection_status() is saying, which doesnt get written until you press to cancel the download or complete the download, so the script is definatly midway in progress at that time. Ive read in teh user contributed notes of somebody else expierencing the same problem as me, that was back in FEB-2002. The hack he has written to use netstat is far to resource intensive. -- Edit bug report at http://bugs.php.net/?id=17774&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17774&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17774&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17774&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17774&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17774&r=support Expected behavior: http://bugs.php.net/fix.php?id=17774&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17774&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17774&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17774&r=globals

« previous php.bugs (#10511) next »