server-side ping management fixed
[brisk.git] / web / Obj / sac-a-push.phh
index c9220a1..fd0368b 100644 (file)
@@ -421,13 +421,12 @@ class Sac_a_push {
                         $content = "";
                         $user->stream_main($content, $get, $post, $cookie);
                         printf("[%s] [%d] [%d]\n", $user->name, $user->lacc, $this->curtime);
-                        if (/* $content == "" && */ $user->ping_req == FALSE 
+                        if ($user->ping_req == FALSE
                             && (($this->curtime - $user->lacc) > (EXPIRE_TIME_RD / 2))) {
-                            // $content = $user->stream_keepalive(TRUE);
-                            $content += $user->stream_keepalive(TRUE);
+                            $content .= $user->stream_keepalive(TRUE);
                             $user->ping_req = TRUE;
                         }
-                        if ($content == "" && $user->rd_kalive_is_expired($this->curtime)) {
+                        else if ($content == "" && $user->rd_kalive_is_expired($this->curtime)) {
                             $content = $user->stream_keepalive(FALSE);
                         }
                         if ($content != "") {