From 29a83e580080f589142bc8639d8a757503fd3175 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Thu, 10 Mar 2011 19:00:29 +0100 Subject: [PATCH] first shmem split --- INSTALL.sh | 52 ++++---- web/Obj/auth.phh | 4 +- web/Obj/brisk.phh | 248 +++++++++++++++++++++++++++++++++----- web/Obj/dbase_base.phh | 2 +- web/Obj/dbase_pgsql.phh | 41 +++++-- web/Obj/hardban.phh | 4 +- web/briskin5/index_rd.php | 2 +- web/index.php | 4 +- web/index_rd.php | 2 +- 9 files changed, 282 insertions(+), 77 deletions(-) diff --git a/INSTALL.sh b/INSTALL.sh index 3f66103..9864b2e 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -107,7 +107,7 @@ function searchetc() { echo "$pp/$dname" return 0 fi - pp="`dirname "$pp"`" + pp="$(dirname "$pp")" done return 1 @@ -120,19 +120,19 @@ while [ $# -gt 0 ]; do # echo aa $1 xx $2 bb conffile="" case $1 in - -f*) conffile="`get_param "-f" "$1" "$2"`"; sh=$?;; - -p*) outconf="`get_param "-p" "$1" "$2"`"; sh=$?;; - -n*) players_n="`get_param "-n" "$1" "$2"`"; sh=$?;; - -t*) tables_n="`get_param "-t" "$1" "$2"`"; sh=$?;; - -T*) tables_auth_n="`get_param "-T" "$1" "$2"`"; sh=$?;; - -a*) brisk_auth_conf="`get_param "-a" "$1" "$2"`"; sh=$?;; - -d*) brisk_debug="`get_param "-d" "$1" "$2"`"; sh=$?;; - -w*) web_path="`get_param "-w" "$1" "$2"`"; sh=$?;; - -k*) ftok_path="`get_param "-k" "$1" "$2"`"; sh=$?;; - -y*) proxy_path="`get_param "-y" "$1" "$2"`"; sh=$?;; - -c*) cookie_path="`get_param "-c" "$1" "$2"`"; sh=$?;; - -C*) brisk_conf="`get_param "-C" "$1" "$2"`"; sh=$?;; - -l*) legal_path="`get_param "-l" "$1" "$2"`"; sh=$?;; + -f*) conffile="$(get_param "-f" "$1" "$2")"; sh=$?;; + -p*) outconf="$(get_param "-p" "$1" "$2")"; sh=$?;; + -n*) players_n="$(get_param "-n" "$1" "$2")"; sh=$?;; + -t*) tables_n="$(get_param "-t" "$1" "$2")"; sh=$?;; + -T*) tables_auth_n="$(get_param "-T" "$1" "$2")"; sh=$?;; + -a*) brisk_auth_conf="$(get_param "-a" "$1" "$2")"; sh=$?;; + -d*) brisk_debug="$(get_param "-d" "$1" "$2")"; sh=$?;; + -w*) web_path="$(get_param "-w" "$1" "$2")"; sh=$?;; + -k*) ftok_path="$(get_param "-k" "$1" "$2")"; sh=$?;; + -y*) proxy_path="$(get_param "-y" "$1" "$2")"; sh=$?;; + -c*) cookie_path="$(get_param "-c" "$1" "$2")"; sh=$?;; + -C*) brisk_conf="$(get_param "-C" "$1" "$2")"; sh=$?;; + -l*) legal_path="$(get_param "-l" "$1" "$2")"; sh=$?;; -W) web_only="TRUE";; -h) usage $0; exit 0;; *) usage $0; exit 1;; @@ -187,8 +187,8 @@ fi # Pre-check # # check for etc path existence -dsta="`dirname "$web_path"`" -etc_path="`searchetc "$dsta" Etc`" +dsta="$(dirname "$web_path")" +etc_path="$(searchetc "$dsta" Etc)" if [ $? -ne 0 ]; then echo "Etc directory not found" exit 1 @@ -234,17 +234,21 @@ if [ "$web_only" = "FALSE" ]; then chmod 666 ${ftokk_path}/warrant touch ${ftokk_path}/poll chmod 666 ${ftokk_path}/poll - for i in `seq 0 99`; do + for i in $(seq 0 99); do touch ${ftokk_path}/table$i chmod 666 ${ftokk_path}/table$i done + for i in $(seq 0 299); do + touch ${ftokk_path}/user$i + chmod 666 ${ftokk_path}/user$i + done fi install -d ${web_path}__ -for i in `find web -type d | grep -v /CVS | sed 's/^....//g'`; do +for i in $(find web -type d | grep -v /CVS | sed 's/^....//g'); do install -d ${web_path}__/$i done -for i in `find web -name '*.php' -o -name '*.phh' -o -name '*.pho' -o -name '*.css' -o -name '*.js' -o -name '*.mp3' -o -name '*.swf' | grep -v /CVS | sed 's/^....//g'`; do +for i in $(find web -name '*.php' -o -name '*.phh' -o -name '*.pho' -o -name '*.css' -o -name '*.js' -o -name '*.mp3' -o -name '*.swf' | grep -v /CVS | sed 's/^....//g'); do install -m 644 web/$i ${web_path}__/$i done @@ -259,16 +263,16 @@ else fi # .js substitutions -sed -i "s/PLAYERS_N *= *[0-9]\+/PLAYERS_N = $players_n/g" `find ${web_path}__ -type f -name '*.js' -exec grep -l 'PLAYERS_N *= *[0-9]\+' {} \;` +sed -i "s/PLAYERS_N *= *[0-9]\+/PLAYERS_N = $players_n/g" $(find ${web_path}__ -type f -name '*.js' -exec grep -l 'PLAYERS_N *= *[0-9]\+' {} \;) -sed -i "s/^var G_send_time *= *[0-9]\+/var G_send_time = $send_time/g" `find ${web_path}__ -type f -name '*.js' -exec grep -l '^var G_send_time *= *[0-9]\+' {} \;` +sed -i "s/^var G_send_time *= *[0-9]\+/var G_send_time = $send_time/g" $(find ${web_path}__ -type f -name '*.js' -exec grep -l '^var G_send_time *= *[0-9]\+' {} \;) # .ph[pho] substitutions -sed -i "s/define *( *PLAYERS_N, *[0-9]\+ *)/define(PLAYERS_N, $players_n)/g" `find ${web_path}__ -type f -name '*.ph*' -exec grep -l 'define *( *PLAYERS_N, *[0-9]\+ *)' {} \;` +sed -i "s/define *( *PLAYERS_N, *[0-9]\+ *)/define(PLAYERS_N, $players_n)/g" $(find ${web_path}__ -type f -name '*.ph*' -exec grep -l 'define *( *PLAYERS_N, *[0-9]\+ *)' {} \;) -sed -i "s/define *( *BRISKIN5_PLAYERS_N, *[0-9]\+ *)/define(BRISKIN5_PLAYERS_N, $players_n)/g" `find ${web_path}__ -type f -name '*.ph*' -exec grep -l 'define *( *BRISKIN5_PLAYERS_N, *[0-9]\+ *)' {} \;` +sed -i "s/define *( *BRISKIN5_PLAYERS_N, *[0-9]\+ *)/define(BRISKIN5_PLAYERS_N, $players_n)/g" $(find ${web_path}__ -type f -name '*.ph*' -exec grep -l 'define *( *BRISKIN5_PLAYERS_N, *[0-9]\+ *)' {} \;) -sed -i "s@define *( *FTOK_PATH,[^)]*)@define(FTOK_PATH, \"$ftok_path\")@g" `find ${web_path}__ -type f -name '*.ph*' -exec grep -l 'define *( *FTOK_PATH,[^)]*)' {} \;` +sed -i "s@define *( *FTOK_PATH,[^)]*)@define(FTOK_PATH, \"$ftok_path\")@g" $(find ${web_path}__ -type f -name '*.ph*' -exec grep -l 'define *( *FTOK_PATH,[^)]*)' {} \;) sed -i "s@define *( *TABLES_N,[^)]*)@define(TABLES_N, $tables_n)@g" ${web_path}__/Obj/brisk.phh diff --git a/web/Obj/auth.phh b/web/Obj/auth.phh index eff784f..29769a2 100644 --- a/web/Obj/auth.phh +++ b/web/Obj/auth.phh @@ -151,7 +151,7 @@ class Challenges { } // Static functions - function &init_data() + static function &create() { $chal =& new Challenges(); @@ -186,7 +186,7 @@ class Challenges { if ($chals == FALSE) { log_only("INIT CHALLENGES DATA"); - $chals =& Challenges::init_data(); + $chals =& Challenges::create(); if (@shm_put_var($shm, $tok, $chals) == FALSE) { log_only("PUT_VAR FALLITA ".strlen(serialize($chals))); log_only(serialize($chals)); diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 07c6168..c5bc2de 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -35,7 +35,11 @@ define(MAX_PLAYERS, (20 + (PLAYERS_N * TABLES_N))); define(SHM_DIMS_MIN, (50000 + 10000 * TABLES_N + 15000 * MAX_PLAYERS)); define(SHM_DIMS_MAX, SHM_DIMS_MIN + 1048576); define(SHM_DIMS_DLT, 65536); - + +define(SHM_DIMS_U_MIN, 4096); +define(SHM_DIMS_U_MAX, 65536); +define(SHM_DIMS_U_DLT, 4096); + define(COMM_N, 18); define(COMM_GEN_N, 50); @@ -604,6 +608,7 @@ define(USER_FLAG_TY_SUSPEND, 0x400000); // done define(USER_FLAG_TY_DISABLE, 0x800000); // done class User { + var $idx; // index in the users array var $code; // authentication code var $name; // name of the user var $sess; // session of the user @@ -635,15 +640,20 @@ class User { var $chat_cur; // Current chat line number var $chat_ban; // Time for ban chat var $chat_dlt; // Delta t for ban + var $shm_sz; + function User() { } - function &create($name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") { + function &create($idx, $name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") { GLOBAL $G_false; + // error_log("User::create BEGIN", 0); + if (($thiz =& new User()) == FALSE) return ($G_false); + $thiz->idx = $idx; $thiz->code = -1; $thiz->name = $name; $thiz->sess = $sess; @@ -673,7 +683,7 @@ class User { $thiz->table = $table; $thiz->table_pos = -1; $thiz->table_token = ""; - + $thiz->shm_sz = SHM_DIMS_U_MIN; return ($thiz); } @@ -681,6 +691,7 @@ class User { { GLOBAL $G_false; + $this->idx = $from->idx; $this->code = $from->code; $this->name = $from->name; $this->sess = $from->sess; @@ -719,7 +730,7 @@ class User { $this->table_pos = $from->table_pos; $this->table_token = $from->table_token; $this->the_end = $from->the_end; - + $this->shm_sz = $from->shm_sz; return (TRUE); } @@ -743,6 +754,7 @@ class User { if (($thiz =& new User()) == FALSE) return ($G_false); + $thiz->idx = $from->idx; $thiz->code = $from->code; $thiz->name = $from->name; $thiz->sess = $from->sess; @@ -783,10 +795,15 @@ class User { $thiz->table = 0; $thiz->table_pos = $table_pos; $thiz->table_token = $from->table_token; + $thiz->shm_sz = $from->shm_sz; return ($thiz); } + function idx_get() { + return ($this->idx); + } + function code_get() { return ($this->code); } @@ -816,7 +833,7 @@ class User { mkdir(PROXY_PATH); if (($fp = @fopen(PROXY_PATH."/".$this->sess.".step", 'w')) == FALSE) break; - fwrite($fp, pack("l",$this->step), 4); + fwrite($fp, pack("LL",$this->step, $this->idx)); fclose($fp); return (TRUE); @@ -832,7 +849,7 @@ class User { if (file_exists(PROXY_PATH) == FALSE) mkdir(PROXY_PATH); $fp = fopen(PROXY_PATH."/".$this->sess.".step", 'w'); - fwrite($fp, pack("l",$this->step), 4); + fwrite($fp, pack("LL", $this->step, $this->idx)); fclose($fp); return (TRUE); @@ -858,12 +875,106 @@ class User { $this->chat_dlt = 0; $this->the_end = FALSE; } -} // end class User + // SHSPLIT save and load function for the User class. + function &load_data($id) + { + GLOBAL $G_false, $sess; + // error_log("User::load_data BEGIN", 0); + $doexit = FALSE; + do { + if (($tok = @ftok(FTOK_PATH."/user".$id, "B")) == -1) { + log_main("ftok failed"); + $doexit = TRUE; + break; + } + + if (($shm_sz = sharedmem_sz($tok)) == -1) { + log_main("shmop_open failed"); + } + + if ($shm_sz == -1) + $shm_sz = SHM_DIMS_U_MIN; + + if ($shm = shm_attach($tok, $shm_sz)) { + $user = @shm_get_var($shm, $tok); + + log_only("bri == ".($user == FALSE ? "FALSE" : "TRUE")." bri === ".($user === FALSE ? "FALSE" : "TRUE")." bri isset ".(isset($user) ? "TRUE" : "FALSE")); + if (isset($user)) + log_only("bri count ".count($user)); + + if ($user == FALSE) { + log_only("INIT MAIN DATA"); + + // SHSPLIT FIXME: init_data for User class ?? + $user =& User::create($id, "", ""); + if (@shm_put_var($shm, $tok, $user) == FALSE) { + log_only("PUT_VAR FALLITA ".strlen(serialize($user))); + log_only(serialize($user)); + } + } + + $user->shm_sz = $shm_sz; + + shm_detach($shm); + } + + // + // SHSPLIT: load users from the shared memory + // + $ret = &$user; + return ($ret); + } while (0); + + if ($doexit) + exit(); + + return ($G_false); + } + + + function save_data(&$user, $id) + { + GLOBAL $sess; + + $shm = FALSE; + + // var_dump($user); + // error_log("User::save_data BEGIN", 0); + + if (($tok = @ftok(FTOK_PATH."/user".$id, "B")) == -1) { + return (FALSE); + } + while ($user->shm_sz < SHM_DIMS_U_MAX) { + if (($shm = shm_attach($tok, $user->shm_sz)) == FALSE) + break; + + // log_only("PUT_VAR DI ".strlen(serialize($user))); + if (shm_put_var($shm, $tok, $user) != FALSE) { + shm_detach($shm); + return (TRUE); + } + if (shm_remove($shm) === FALSE) { + log_only("REMOVE FALLITA"); + break; + } + shm_detach($shm); + $user->shm_sz += SHM_DIMS_U_DLT; + } + + if ($shm) + shm_detach($shm); + + return (FALSE); + } + + + +} // end class User function step_get($sess) { @@ -876,15 +987,15 @@ function step_get($sess) { mkdir(PROXY_PATH); if (($fp = @fopen(PROXY_PATH."/".$sess.".step", 'rb')) == FALSE) break; - if (($s = fread($fp, 4)) == FALSE) + if (($s = fread($fp, 8)) == FALSE) break; - if (strlen($s) != 4) + if (strlen($s) != 8) break; - $arr = unpack('l', $s); + $arr = unpack('Ls/Li', $s); fclose($fp); // log_rd2("A0: ".$arr[0]." A1: ".$arr[1]); - return ($arr[1]); + return ($arr); } while (0); if ($fp != FALSE) @@ -916,7 +1027,7 @@ class Room { $this->table = array(); for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { - $this->user[$i] =& User::create("", ""); + $this->user[$i] =& User::create($i, "", ""); } for ($i = 0 ; $i < TABLES_N ; $i++) { @@ -937,6 +1048,7 @@ class Room { $this->table[$i]->auth_only = FALSE; } $this->garbage_timeout = 0; + $this->shm_sz = SHM_DIMS_MIN; } function garbage_manager($force) @@ -1453,6 +1565,7 @@ class Room { $msg = substr($mesg, 6, 128); $curtime = time(); $dt = date("H:i ", $curtime); + $target = ""; // // Compute actions @@ -1890,6 +2003,8 @@ class Room { $idx = 0; + error_log("add_user: G_false: [".$G_false."]", 0); + $authenticate = FALSE; $user_type = 0; $login_exists = FALSE; @@ -1919,6 +2034,7 @@ class Room { log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE")); if ($authenticate != FALSE) { + error_log(print_r(&$authenticate, TRUE),0); $user_type = $authenticate->type_get(); } else { @@ -2118,18 +2234,21 @@ class Room { } // Static functions - function &init_data() + static function &create() { $room =& new Room(); return $room; } - + function &load_data() { GLOBAL $G_false, $sess; $doexit = FALSE; + + // error_log("Room::load_data BEGIN", 0); + do { if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1) { log_main("ftok failed"); @@ -2145,25 +2264,37 @@ class Room { $shm_sz = SHM_DIMS_MIN; if ($shm = shm_attach($tok, $shm_sz)) { - $room = @shm_get_var($shm, $tok); - - log_only("bri == ".($room == FALSE ? "FALSE" : "TRUE")." bri === ".($room === FALSE ? "FALSE" : "TRUE")." bri isset ".(isset($room) ? "TRUE" : "FALSE")); - if (isset($room)) - log_only("bri count ".count($room)); - - if ($room == FALSE) { - log_only("INIT MAIN DATA"); - - $room =& Room::init_data(); - if (@shm_put_var($shm, $tok, $room) == FALSE) { - log_only("PUT_VAR FALLITA ".strlen(serialize($room))); - log_only(serialize($room)); - } - } - $room->shm_sz = $shm_sz; - - shm_detach($shm); + $room = @shm_get_var($shm, $tok); + + log_only("bri == ".($room == FALSE ? "FALSE" : "TRUE")." bri === ".($room === FALSE ? "FALSE" : "TRUE")." bri isset ".(isset($room) ? "TRUE" : "FALSE")); + if (isset($room)) + log_only("bri count ".count($room)); + + if ($room == FALSE) { + log_only("INIT MAIN DATA"); + shm_detach($shm); + + // error_log("DE CHE", 0); + + $room =& Room::create(); + + if (Room::save_data($room) == FALSE) + return $G_false; + + return $room; + } + $room->shm_sz = $shm_sz; + + shm_detach($shm); + + for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { + $room->user[$i] = User::load_data($i); + } } + + // + // SHSPLIT: load users from the shared memory + // $ret = &$room; return ($ret); } while (0); @@ -2175,7 +2306,7 @@ class Room { } - function save_data(&$room) + function save_data_orig(&$room) { GLOBAL $sess; @@ -2209,6 +2340,57 @@ class Room { return (FALSE); } + + function save_data(&$room) + { + GLOBAL $sess; + + $ret = FALSE; + $shm = FALSE; + + // var_dump($room); + // error_log("Room::save_data BEGIN", 0); + + if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1) + return (FALSE); + + // SHSPLIT: before save the $room you must save users, + // detach from main struct and (then) reattach + $user_park = array(); + for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { + $user_park[$i] = $room->user[$i]; + $room->user[$i] = FALSE; + } + + while ($room->shm_sz < SHM_DIMS_MAX) { + if (($shm = shm_attach($tok, $room->shm_sz)) == FALSE) + break; + + // log_only("PUT_VAR DI ".strlen(serialize($room))); + if (shm_put_var($shm, $tok, $room) != FALSE) { + $ret = TRUE; + break; + } + if (shm_remove($shm) === FALSE) { + log_only("REMOVE FALLITA"); + break; + } + shm_detach($shm); + $room->shm_sz += SHM_DIMS_DLT; + } + + if ($shm) + shm_detach($shm); + + // SHSPLIT: reattach users to the room class + for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { + User::save_data($user_park[$i], $i); + $room->user[$i] = $user_park[$i]; + } + + return ($ret); + } + function lock_data() { GLOBAL $sess; diff --git a/web/Obj/dbase_base.phh b/web/Obj/dbase_base.phh index a827725..83d49e6 100644 --- a/web/Obj/dbase_base.phh +++ b/web/Obj/dbase_base.phh @@ -41,7 +41,7 @@ class LoginDBItem { static function &LoginDBItemFromRecord($rec) { - $ret = & new LoginDBItem($rec->code, $rec->login, $rec->pass, + $ret =& new LoginDBItem($rec->code, $rec->login, $rec->pass, $rec->email, $rec->type); return ($ret); diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index f4aa819..c69ab16 100644 --- a/web/Obj/dbase_pgsql.phh +++ b/web/Obj/dbase_pgsql.phh @@ -56,9 +56,9 @@ class DBConn } } - $ret = new DBConn(); + $out = new DBConn(); - return $ret; + return $out; } function db() { @@ -81,20 +81,21 @@ class BriskDB { GLOBAL $DOCUMENT_ROOT, $G_dbpfx, $G_false; - $dbconn = $G_false; - $ret = $G_false; + $ret = FALSE; log_main("BriskDB create:start"); do { - if (($dbconn = DBConn::create()) == FALSE) + if (($dbconn = DBConn::create()) == FALSE) break; $ret = new BriskDB($dbconn); } while (0); - log_main("BriskDB create:end"); - return ($ret); + if ($ret) + return ($ret); + else + return ($G_false); } function users_load() @@ -138,7 +139,9 @@ class BriskDB { GLOBAL $G_dbpfx, $G_false; - $ret = &$G_false; + error_log("dbase_pgsql G_false: [".$G_false."]", 0); + + $ret = FALSE; log_main("login_verify: ".$login); @@ -147,29 +150,38 @@ class BriskDB //O for ($i = 0 ; $i < $this->item_n ; $i++) { //O log_main("login_verify: BEGIN"); - if (($user_obj = $this->getrecord_bylogin($login)) == FALSE) - return $ret; + if (($user_obj = $this->getrecord_bylogin($login)) == FALSE) { + return $G_false; + } + + error_log("G_false: [".$G_false."] user_obj: ".print_r($user_obj, TRUE), 0); log_main("login[".$user_obj->code."]: ".$user_obj->login); /* if it exists check for a valid challenge */ if (($a_sem = Challenges::lock_data()) != FALSE) { + error_log("loop-2", 0); if (($chals = &Challenges::load_data()) != FALSE) { + error_log("loop-1", 0); for ($e = 0 ; $e < $chals->item_n ; $e++) { - + error_log("loop", 0); log_main("challenge[".$e."]: ".$chals->item[$e]->login); if (strcmp($login, $chals->item[$e]->login) == 0) { + error_log("loop2", 0); log_main("login_verify [".$pass."] with [".md5($chals->item[$e]->token.$user_obj->pass)."]"); if (strcmp($pass, md5($chals->item[$e]->token.$user_obj->pass)) == 0) { + error_log("loop3", 0); log_main("login_verify SUCCESS for ".$login); $chals->rem($login); $ret = LoginDBItem::LoginDBItemFromRecord($user_obj); + error_log("dbitem: ".print_r($ret, TRUE)); break; } } } // end for ($e = 0 ... + error_log("end loop-1", 0); } if ($chals->ismod()) { @@ -182,7 +194,12 @@ class BriskDB // O } // if (strcasecmp($this->item[$i]->login, ... //O } - return ($ret); + error_log("return: ".($G_false == FALSE ? "FALSE" : "not FALSE"), 0); + + if ($ret) + return ($ret); + else + return ($G_false); } function &getitem_bylogin($login, &$id) { diff --git a/web/Obj/hardban.phh b/web/Obj/hardban.phh index dcdeb01..99b7033 100644 --- a/web/Obj/hardban.phh +++ b/web/Obj/hardban.phh @@ -143,7 +143,7 @@ class Hardbans { } // Static functions - function &init_data() + static function &create() { $chal =& new Hardbans(); @@ -178,7 +178,7 @@ class Hardbans { if ($hban == FALSE) { log_only("INIT HARDBAN DATA"); - $hban =& Hardbans::init_data(); + $hban =& Hardbans::create(); if (@shm_put_var($shm, $tok, $hban) == FALSE) { log_only("PUT_VAR FALLITA ".strlen(serialize($hban))); log_only(serialize($hban)); diff --git a/web/briskin5/index_rd.php b/web/briskin5/index_rd.php index 2a35220..0d2314c 100644 --- a/web/briskin5/index_rd.php +++ b/web/briskin5/index_rd.php @@ -120,7 +120,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if (($proxy_step = step_get($sess)) != FALSE) { // log_rd2("Postget".$proxy_step."zizi"); - if ($cur_step == $proxy_step) { + if ($cur_step == $proxy_step['s']) { log_lock("P"); return (FALSE); } diff --git a/web/index.php b/web/index.php index 5fd269d..551dd79 100644 --- a/web/index.php +++ b/web/index.php @@ -225,7 +225,7 @@ function main() GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local; GLOBAL $G_with_sidebanner, $G_sidebanner; GLOBAL $G_with_sidebanner2, $G_sidebanner2; - GLOBAL $G_with_poll; + GLOBAL $G_with_poll, $G_false; GLOBAL $sess, $name, $pass_private, $table_idx, $table_token, $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER; GLOBAL $G_lang, $G_lng, $mlang_room; $is_login = FALSE; @@ -234,6 +234,8 @@ function main() $standup = ""; $ACTION = "login"; + error_log("main: G_false: [".$G_false."]", 0); + if (isset($BRISK_SHOWHTML) == FALSE) { $is_table = FALSE; $sem = Room::lock_data(); diff --git a/web/index_rd.php b/web/index_rd.php index 7112182..88c740b 100644 --- a/web/index_rd.php +++ b/web/index_rd.php @@ -135,7 +135,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if (($proxy_step = step_get($sess)) != FALSE) { // log_rd2("Postget".$proxy_step."zizi"); - if ($cur_step == $proxy_step) { + if ($cur_step == $proxy_step['s']) { log_lock("P"); return (FALSE); } -- 2.17.1