try close when socket return 0 bytes
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sat, 11 Apr 2020 15:36:52 +0000 (17:36 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sat, 11 Apr 2020 15:36:52 +0000 (17:36 +0200)
web/Obj/sac-a-push.phh

index 4d8706b..a52b574 100644 (file)
@@ -846,7 +846,7 @@ class Sac_a_push {
                     else if ($id % SOCK_SHARD_N == $sock_shard_cur) {  // already opened socket
                         $buf = fread($sock, 4096);
                         // if socket is closed
-                        if ($buf == FALSE || feof($sock)) {
+                        if ($buf == FALSE || mb_strlen($buf, "ASCII") == 0 || feof($sock)) {
                             $postclose = NULL;
                             // close socket case
                             if ($buf == FALSE) {