+ if (($user = Bin5_user::load_data($table_idx, $proxy_step['i'], $sess)) == FALSE) {
+ Bin5::unlock_data($sem);
+ ignore_user_abort(FALSE);
+ return (blocking_error(TRUE));
+ }
+
+ /* if lacc time great than STREAM_TIMEOUT or the room garbage_time is expired
+ switch to exclusive locking and verify again the conditions */
+
+ if ((($curtime - $user->lacc) > STREAM_TIMEOUT) || Bin5::garbage_time_is_expired($table_idx, $curtime)) {
+ Bin5::unlock_data($sem);
+
+ // exclusive locking to modify info
+ if (($sem = Bin5::lock_data(TRUE, $table_idx)) == FALSE) {
+ // wait 20 secs, then restart the xhr
+ ignore_user_abort(FALSE);
+ return ("sleep(gst,20000);|hstm.xhr_abort();");
+ }
+ $S_load_stat['lL_laccgarb']++;
+
+ unset($user);
+ // load again the user data after new lock
+ if (($user = Bin5_user::load_data($table_idx, $proxy_step['i'], $sess)) == FALSE) {
+ Bin5::unlock_data($sem);
+ ignore_user_abort(FALSE);
+ return (blocking_error(TRUE));
+ }
+
+ if (($curtime - $user->lacc) > STREAM_TIMEOUT) {
+ $S_load_stat['wU_lacc_upd']++;
+ $user->lacc = $curtime;
+ // lacc field updated
+ Bin5_user::save_data($user, $table_idx, $user->idx);
+ }
+
+ if (Bin5::garbage_time_is_expired($table_idx, $curtime)) {
+ log_only("F");
+
+ $S_load_stat['wR_garbage']++;
+ if (($bri = Bin5::load_data($table_idx, $table_token)) == FALSE) {