unlock_data without arg fixed
[brisk.git] / web / index_rd.php
index c775dc1..d5c5d87 100644 (file)
@@ -58,10 +58,9 @@ if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
 
 function shutta()
 {
-  log_rd2("SHUTTA!".connection_status());
+  log_rd2("SHUTTA [".connection_status()."] !");
 }
 
-
 register_shutdown_function(shutta);
 
 function unrecerror()
@@ -105,7 +104,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);
     }
@@ -118,7 +119,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
             // Aggiorna l'expire time lato server
             $S_load_stat['U_first_loop']++;
             if (($user = User::load_data($proxy_step['i'], $sess)) == FALSE) {
-                Room::unlock_data();
+                Room::unlock_data($sem);
                 ignore_user_abort(FALSE);
                 return (unrecerror());
             }
@@ -130,7 +131,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
                 
                 $S_load_stat['R_garbage']++;
                 if (($room = Room::load_data()) == FALSE) {
-                    Room::unlock_data();
+                    Room::unlock_data($sem);
                     ignore_user_abort(FALSE);
                     return (unrecerror());
                 }
@@ -139,7 +140,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
                 Room::save_data($room);
                 unset($room);
             }
-            log_lock("U");
+            log_main("infolock: U");
             Room::unlock_data($sem);
             ignore_user_abort(FALSE);
         } // if (($sem = Room::lock_data()) != FALSE) { 
@@ -153,7 +154,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
     } // if  ($first_loop == TRUE) {
     
     if ($cur_step == $proxy_step['s']) {
-        log_lock("P");
+        log_main("infolock: P");
         return (FALSE);
     }
     else {
@@ -167,7 +168,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
             if (($sem = Room::lock_data()) == FALSE) 
                 break;
             
-            log_lock("P");
+            log_main("infolock: P");
             $S_load_stat['U_heavy']++;
             if (($user = User::load_data($proxy_step['i'], $sess)) == FALSE) {
                 break;
@@ -281,7 +282,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
         $sem = Room::lock_data();
         $S_load_stat['U_heavy']++;
         if (($user = User::load_data($proxy_step['i'], $sess)) == FALSE) {
-            Room::unlock_data();
+            Room::unlock_data($sem);
             ignore_user_abort(FALSE);
             return (unrecerror());
         }