From 8c1df4ebf55f715144a422cdb4be7eee48f1b5d2 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Thu, 26 Jul 2012 08:44:07 +0200 Subject: [PATCH] fix bug for already closed readed socket --- web/spush/brisk-spush.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/spush/brisk-spush.php b/web/spush/brisk-spush.php index 9593450..a811a29 100755 --- a/web/spush/brisk-spush.php +++ b/web/spush/brisk-spush.php @@ -173,6 +173,11 @@ function main() } /* At least at one of the sockets something interesting happened */ foreach ($read as $i => $sock) { + /* is_resource check is required because there is the possibility that + during new request an old connection is closed */ + if (!is_resource($sock)) { + continue; + } if ($sock === $list) { printf("NUOVA CONNEX\n"); $new_unix = stream_socket_accept($list); -- 2.17.1