projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SPIA to full length response
[brisk.git]
/
web
/
Obj
/
sac-a-push.phh
diff --git
a/web/Obj/sac-a-push.phh
b/web/Obj/sac-a-push.phh
index
746f7ec
..
cd0d6ab
100644
(file)
--- a/
web/Obj/sac-a-push.phh
+++ b/
web/Obj/sac-a-push.phh
@@
-346,7
+346,6
@@
class Sac_a_push {
else {
if (($buf = fread($sock, 512)) === FALSE) {
printf("error read\n");
else {
if (($buf = fread($sock, 512)) === FALSE) {
printf("error read\n");
- exit(123);
}
else if (strlen($buf) === 0) {
if ($sock === $this->list) {
}
else if (strlen($buf) === 0) {
if ($sock === $this->list) {
@@
-371,7
+370,7
@@
class Sac_a_push {
}
}
else {
}
}
else {
- if ($debug > 1) {
+ if ($
this->
debug > 1) {
print_r($read);
}
if ($sock === $this->list) {
print_r($read);
}
if ($sock === $this->list) {
@@
-405,10
+404,18
@@
class Sac_a_push {
if (isset($this->s2u[intval($sock)])) {
$user = $this->s2u[intval($sock)];
$response = $user->rd_cache_get();
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);
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();
}
if ($content == "" && $user->rd_kalive_is_expired($this->curtime)) {
$content = $user->stream_keepalive();
}
@@
-418,7
+425,8
@@
class Sac_a_push {
}
if ($response != "") {
}
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) {
$response_l = mb_strlen($response, "ASCII");
$wret = @fwrite($sock, $response);
if ($wret < $response_l) {