X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fsac-a-push.phh;h=cd0d6abb81bd0dc67a4795876e9d90fca90ac431;hb=2a82f64f7c99c99b0c38fa2911ddfda0b6609ae7;hp=bc0ea8723922f408766710593460d4f2f9e5a557;hpb=64168bc6e7d5cfe46ac0120bb7b449b5d5f37c1b;p=brisk.git diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index bc0ea87..cd0d6ab 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -404,10 +404,18 @@ class Sac_a_push { if (isset($this->s2u[intval($sock)])) { $user = $this->s2u[intval($sock)]; $response = $user->rd_cache_get(); + if (($this->curtime - $user->lacc) <= (EXPIRE_TIME_RD / 2)) { + $user->ping_req = FALSE; + } if ($response == "") { $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 + && (($this->curtime - $user->lacc) > (EXPIRE_TIME_RD / 2))) { + $content = $user->stream_ping(); + $user->ping_req = TRUE; + } if ($content == "" && $user->rd_kalive_is_expired($this->curtime)) { $content = $user->stream_keepalive(); } @@ -417,7 +425,8 @@ class Sac_a_push { } if ($response != "") { - echo "SPIA: [".substr($response, 0, 60)."...]\n"; + // echo "SPIA: [".substr($response, 0, 60)."...]\n"; + echo "SPIA: [".$response."...]\n"; $response_l = mb_strlen($response, "ASCII"); $wret = @fwrite($sock, $response); if ($wret < $response_l) {