method to identify closed socket changed
[brisk.git] / web / Obj / sac-a-push.phh
index cb10643..f9255c6 100644 (file)
@@ -626,6 +626,7 @@ class Sac_a_push {
         $this->main_loop = TRUE;
         
         while ($this->main_loop) {
+            $this->app->sess_cur_set(FALSE);
             $this->curtime = time();
             fprintf(STDERR, "IN LOOP: Current opened: %d  pending_pages: %d\n", count($this->socks), count($this->pending_pages));
             
@@ -719,7 +720,7 @@ class Sac_a_push {
                     else {
                         $buf = fread($sock, 4096);
                         // if socket is closed
-                        if ($buf == FALSE || mb_strlen($buf, "ASCII") == 0) {
+                        if ($buf == FALSE || feof($sock)) {
                             // close socket case
                             if ($buf == FALSE) {
                                 printf("INFO: read return false\n");