From: Matteo Nastasi (mop) Date: Wed, 30 Mar 2011 16:45:47 +0000 (+0200) Subject: proxy step paradigm changed from set and get to load and save sincronously with load... X-Git-Tag: 3.5.1~4 X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=45fd3084c52ef5c560300fa32a2fef75edc47ca7;p=brisk.git proxy step paradigm changed from set and get to load and save sincronously with load and save user data --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index ecee1af..799ea68 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -979,6 +979,8 @@ class User { // log_only("PUT_VAR DI ".strlen(serialize($user))); if (shm_put_var($shm, $tok, $user) != FALSE) { shm_detach($shm); + if ($user->sess != "") + $user->save_step(); log_main("User[".$id."] saved."); return (TRUE); } diff --git a/web/briskin5/index_rd.php b/web/briskin5/index_rd.php index 81c05f9..6732873 100644 --- a/web/briskin5/index_rd.php +++ b/web/briskin5/index_rd.php @@ -88,7 +88,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su $user = FALSE; $curtime = time(); - if (($proxy_step = Bin5_user::step_get($sess)) == FALSE) { + if (($proxy_step = Bin5_user::load_step($sess)) == FALSE) { log_only2("R"); return (FALSE); } @@ -100,13 +100,15 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if (($sem = Bin5::lock_data($table_idx)) != FALSE) { // Aggiorna l'expire time lato server $S_load_stat['U_first_loop']++; + if (($user = Bin5_user::load_data($table_idx, $proxy_step['i'], $sess)) == FALSE) { Bin5::unlock_data(); ignore_user_abort(FALSE); return (unrecerror()); } $user->lacc = $curtime; - Bin5_user::save_data($user, $proxy_step['i'], $user->idx); + + Bin5_user::save_data($user, $table_idx, $user->idx); if (Bin5::garbage_time_is_expired($curtime)) { log_only("F"); diff --git a/web/index_rd.php b/web/index_rd.php index c775dc1..d061b0e 100644 --- a/web/index_rd.php +++ b/web/index_rd.php @@ -105,7 +105,9 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su $user = FALSE; $curtime = time(); - if (($proxy_step = User::step_get($sess)) == FALSE) { + // NOTE: qui forse si potrebbe fallback-are a una User::load_data + // anche se non ce ne dovrebbe essere mai la necessità + if (($proxy_step = User::load_step($sess)) == FALSE) { log_only2("R"); return (FALSE); }