projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
all rd stuff to manage fwrite fail, rd_keepalive and rd_endstream
[brisk.git]
/
web
/
Obj
/
brisk.phh
diff --git
a/web/Obj/brisk.phh
b/web/Obj/brisk.phh
index
fb88f57
..
388838b
100644
(file)
--- a/
web/Obj/brisk.phh
+++ b/
web/Obj/brisk.phh
@@
-690,7
+690,9
@@
define('USER_FLAG_TY_SUPER', 0x020000); // done
define('USER_FLAG_TY_SUSPEND', 0x400000); // done
define('USER_FLAG_TY_DISABLE', 0x800000); // done
define('USER_FLAG_TY_SUSPEND', 0x400000); // done
define('USER_FLAG_TY_DISABLE', 0x800000); // done
-define('RD_STREAM_TIMEOUT', 4);
+// 240 is the right value, 600 is for fwrite error test
+define('RD_ENDTIME_DELTA', 240);
+define('RD_KEEPALIVE_TOUT', 4);
class User {
var $idx; // index in the users array when you are in game
class User {
var $idx; // index in the users array when you are in game
@@
-714,7
+716,8
@@
class User {
var $rd_step; // actual step of push stream
var $rd_from; // referer
var $rd_scristp; // current script step (for each session)
var $rd_step; // actual step of push stream
var $rd_from; // referer
var $rd_scristp; // current script step (for each session)
- var $rd_tout; // if no message are sent after RD_STREAM_TIMEOUT secs we send a keepalive from server
+ var $rd_kalive; // if no message are sent after RD_KEEPALIVE_TOUT secs we send a keepalive from server
+ var $rd_cache; // store place where failed fwrite data
var $comm; // commands array
// var $asta_card; //
var $comm; // commands array
// var $asta_card; //
@@
-767,7
+770,8
@@
class User {
$thiz->rd_step = -1;
$thiz->rd_from = "";
$thiz->rd_scristp = -1;
$thiz->rd_step = -1;
$thiz->rd_from = "";
$thiz->rd_scristp = -1;
- $thiz->rd_tout = -1;
+ $thiz->rd_kalive = -1;
+ $thiz->rd_cache = "";
$thiz->asta_card = -2;
$thiz->asta_pnt = -1;
$thiz->asta_card = -2;
$thiz->asta_pnt = -1;
@@
-903,13
+907,13
@@
class User {
function rd_data_set($curtime, $stat, $subst, $step, $from)
{
function rd_data_set($curtime, $stat, $subst, $step, $from)
{
- $this->rd_endtime = $curtime +
STREAM_TIMEOUT
;
+ $this->rd_endtime = $curtime +
RD_ENDTIME_DELTA
;
$this->rd_stat = $stat;
$this->rd_subst = $subst;
$this->rd_step = $step;
$this->rd_from = $from;
$this->rd_scristp = 0;
$this->rd_stat = $stat;
$this->rd_subst = $subst;
$this->rd_step = $step;
$this->rd_from = $from;
$this->rd_scristp = 0;
- $this->rd_
tout = $curtime + RD_STREAM_TIME
OUT;
+ $this->rd_
kalive = $curtime + RD_KEEPALIVE_T
OUT;
}
function rd_socket_get() {
}
function rd_socket_get() {
@@
-920,31
+924,41
@@
class User {
$this->rd_socket = $sock;
}
$this->rd_socket = $sock;
}
- function rd_
tout
_get()
+ function rd_
kalive
_get()
{
{
- return ($this->rd_
tout
);
+ return ($this->rd_
kalive
);
}
}
- function rd_
tout
_set($tm)
+ function rd_
kalive
_set($tm)
{
{
- $this->rd_
tout
= $tm;
+ $this->rd_
kalive
= $tm;
}
}
- function rd_
tout
_is_expired($tm)
+ function rd_
kalive
_is_expired($tm)
{
{
- // printf("rd_
tout %d tm %d\n", $this->rd_tout
, $tm);
- return ($this->rd_
tout
< $tm);
+ // printf("rd_
kalive %d tm %d\n", $this->rd_kalive
, $tm);
+ return ($this->rd_
kalive
< $tm);
}
function rd_endtime_is_expired($tm)
{
}
function rd_endtime_is_expired($tm)
{
- // printf("rd_endtime %d tm %d\n", $this->rd_
tout
, $tm);
+ // printf("rd_endtime %d tm %d\n", $this->rd_
kalive
, $tm);
return ($this->rd_endtime < $tm);
}
return ($this->rd_endtime < $tm);
}
- function rd_
tout
_reset($tm)
+ function rd_
kalive
_reset($tm)
{
{
- $this->rd_tout = $tm + RD_STREAM_TIMEOUT;
+ $this->rd_kalive = $tm + RD_KEEPALIVE_TOUT;
+ }
+
+ function rd_cache_get()
+ {
+ return ($this->rd_cache);
+ }
+
+ function rd_cache_set($cache)
+ {
+ $this->rd_cache = $cache;
}
function idx_get() {
}
function idx_get() {