|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-12-07 13:08 UTC] rasmus at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 11:00:02 2025 UTC |
I can not get the connection_aborted() function to work properly, without flushing the output buffer a couple of times first. Snip 1. Reports the connection as aborted if you interrupt the page download with "stop". Behaves correctly. <? ignore_user_abort(1); for($i=0; $i<7; $i++) { sleep(1); echo "$i<BR>"; flush(); } $fp = fopen("/tmp/conn.txt","a"); if(connection_aborted()) fputs($fp,"** the connection was aborted **\n"); else fputs($fp,"** the connection was OK **\n"); exit; ?> Snip 2. Says that the connection is OK, even though I've hit the "stop" button on my browser. <? ignore_user_abort(1); for($i=0; $i<7; $i++) { sleep(1); echo "$i<BR>"; // flush(); } $fp = fopen("/tmp/conn.txt","a"); if(connection_aborted()) fputs($fp,"** the connection was aborted **\n"); else fputs($fp,"** the connection was OK **\n"); exit; ?>