send last command on transport channel before logout with relative infrastructure
[brisk.git] / web / Obj / sac-a-push.phh
index 619d0b2..b4ec956 100644 (file)
@@ -39,7 +39,7 @@ $_globals_list = array(
 'G_mail_seed', 'G_notguar_code', 'G_PG_cons', 'G_PG_cons_n', 'G_PG_vow',
 'G_PG_vow_n', 'G_poll_entries', 'G_poll_name', 'G_poll_title',
 'G_provider_proxy', 'G_proxy_white_list', 'G_room_about', 'G_room_help',
-'G_room_passwdhowto', 'G_room_roadmap', 'G_room_whysupport',
+'G_room_passwdhowto', 'G_room_roadmap',
 'G_selfreg_mask', 'G_selfreg_tout', 'G_shutdown', 'G_sidebanner',
 'G_sidebanner_idx', 'G_splash_content', 'G_splash_contents',
 'G_splash_cont_idx', 'G_splash_h', 'G_splash_idx', 'G_splash_interval',
@@ -631,14 +631,18 @@ class Sac_a_push {
         foreach ($this->socks as $k => $sock) {
             $id = intval($sock);
             if (isset($this->s2u[$id])) {
-                if ($this->s2u[$id]->the_end) {
-                    if ($this->s2u[$id]->rd_socket_get() != NULL) {
-                        $this->s2u[$id]->rd_socket_set(NULL);
+                $user = $this->s2u[$id];
+                if ($user->the_end) {
+                    if (($user->rd_toflush == FALSE && $user->rd_step == $user->step)
+                        || $user->rd_endtime_is_expired($this->curtime)) {
+                        if ($user->rd_socket_get() != NULL) {
+                            $user->rd_socket_set(NULL);
+                        }
+                        unset($this->socks[$id]);
+                        unset($this->s2u[$id]);
+                        fclose($sock);
+                        printf("CLOSE ON GARBAGE MANAGER\n");
                     }
-                    unset($this->socks[$id]);
-                    unset($this->s2u[$id]);
-                    fclose($sock);
-                    printf("CLOSE ON GARBAGE MANAGER\n");
                 }
             }
         }