note 112235 added to features.connection-handling
| From: | tomas dot burba at softneta dot lt | Date: | Mon, 20 May 2013 23:15:07 +0000 |
| Subject: | note 112235 added to features.connection-handling | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194867@lists.php.net to get a copy of this message | ||
Even with ob_flush() and flush(), PHP may be unable to detect the connection status change due to *a
firewall on client's machine*.
Consider a browser receiving the output of a script. The script regularly outputs something
innocent, like "<br>".
a) The Stop button is pressed. The browser instructs to close the connection gracefully, TCP/IP
stack exchanges those final FIN and ACK packets, and the server knows that the client went away.
b) The entire browser is killed. The client's stack sees that nobody is using the socket, so
the next data packet from server will be answered with a TCP RST, and the server immediately knows
there is no client.
But, a stealth firewall is designed to block those RST messages as well. The server's stack
will only see absence of ACK replies, and therefore will occasionally retransmit the entire bunch of
accumulated data. Only after a certain number of retransmission failures, this will be considered a
connection loss and propagated up to PHP.
In my case, turning off the Comodo Firewall at the client changed the situation immediately.
----
Server IP: 69.147.83.199
Probable Submitter: 193.219.160.253
----
Manual Page -- http://php.net/manual/en/features.connection-handling.php
Edit -- https://master.php.net/note/edit/112235
Del: integrated -- https://master.php.net/note/delete/112235/integrated
Del: useless -- https://master.php.net/note/delete/112235/useless
Del: bad code -- https://master.php.net/note/delete/112235/bad+code
Del: spam -- https://master.php.net/note/delete/112235/spam
Del: non-english -- https://master.php.net/note/delete/112235/non-english
Del: in docs -- https://master.php.net/note/delete/112235/in+docs
Del: other reasons-- https://master.php.net/note/delete/112235
Reject -- https://master.php.net/note/reject/112235
Search -- https://master.php.net/manage/user-notes.php