close socket if request_mgr fails
[brisk.git] / web / Obj / sac-a-push.phh
index 5f9818a..d9ee5ad 100644 (file)
@@ -605,7 +605,7 @@ class Sac_a_push {
         foreach ($this->socks as $k => $sock) {
             $id = intval($sock);
             if (isset($this->s2u[$id])) {
-                if ($this->s2u[$id]->sess == '') {
+                if ($this->s2u[$id]->the_end) {
                     if ($this->s2u[$id]->rd_socket_get() != NULL) {
                         $this->s2u[$id]->rd_socket_set(NULL);
                     }
@@ -616,6 +616,7 @@ class Sac_a_push {
                 }
             }
         }
+        $this->app->users_cleanup();
     }
 
     function run()
@@ -850,6 +851,7 @@ class Sac_a_push {
                         if ($rret == FALSE) {
                             // FIXME: manage 404 !!!
                             printf("TODO: fix unknown page\n");
+                            fclose($new_socket);
                         }
                     }
                 }