X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fsac-a-push.phh;h=af056d590ba8494047d3c81ca8a4302cebee926d;hb=c75db73487fbf95bd83d842b60827573ff30cfc7;hp=8f0dbc3fe84e6049c20a60c6095af9ba520e4ebc;hpb=4651656d8aac1a637f541e1c9b3a026461ca7b19;p=brisk.git diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index 8f0dbc3..af056d5 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -368,15 +368,18 @@ class Sac_a_push { } } else { - if (($buf = fread($sock, 512)) === FALSE) { - printf("error read\n"); - } - else if (strlen($buf) === 0) { + $buf = fread($sock, 512); + if ($buf == FALSE || strlen($buf) == 0) { + if ($buf == FALSE) { + printf("ERROR READING\n"); + } if ($sock === $this->list) { printf("Arrivati %d bytes da list\n", strlen($buf)); + exit(21); } else if ($sock === $this->in) { printf("Arrivati %d bytes da stdin\n", strlen($buf)); + exit(22); } else { // $user_a[$s2u[intval($sock)]]->disable(); @@ -385,9 +388,10 @@ class Sac_a_push { } unset($this->socks[intval($sock)]); unset($this->s2u[intval($sock)]); - fclose($sock); - printf("CLOSE ON READ\n"); } + fclose($sock); + printf("CLOSE ON READ\n"); + if ($this->debug > 1) { printf("post unset\n"); print_r($this->socks);