projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unrecerror converted to blocking_error function
[brisk.git]
/
web
/
index_rd.php
diff --git
a/web/index_rd.php
b/web/index_rd.php
index
fc8aa0c
..
ebb28d3
100644
(file)
--- a/
web/index_rd.php
+++ b/
web/index_rd.php
@@
-63,13
+63,13
@@
function shutta()
register_shutdown_function(shutta);
register_shutdown_function(shutta);
-function
unrecerror(
)
+function
blocking_error($is_unrecoverable
)
{
GLOBAL $is_page_streaming;
$is_page_streaming = TRUE;
{
GLOBAL $is_page_streaming;
$is_page_streaming = TRUE;
- log_rd2("
UNREC_ERROR:".var_export(debug_backtrace()
));
- return (sprintf(
'the_end=true; window.onunload = null; window.onbefore
unload = null; document.location.assign("index.php");'));
+ log_rd2("
BLOCKING_ERROR UNREC: ".($is_unrecoverable ? "TRUE" : "FALSE"
));
+ return (sprintf(
($is_unrecoverable ? 'the_end=true; ' : '').'window.onbeforeunload = null; window.on
unload = null; document.location.assign("index.php");'));
}
function page_sync($sess, $page, $table_idx, $table_token)
}
function page_sync($sess, $page, $table_idx, $table_token)
@@
-108,7
+108,8
@@
function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
// anche se non ce ne dovrebbe essere mai la necessità
if (($proxy_step = User::load_step($sess)) == FALSE) {
log_only2("R");
// anche se non ce ne dovrebbe essere mai la necessità
if (($proxy_step = User::load_step($sess)) == FALSE) {
log_only2("R");
- return (FALSE);
+ ignore_user_abort(FALSE);
+ return (blocking_error(TRUE));
}
// log_rd2("M");
}
// log_rd2("M");
@@
-119,9
+120,9
@@
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) {
// 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);
ignore_user_abort(FALSE);
- return (
unrecerror(
));
+ return (
blocking_error(TRUE
));
}
$user->lacc = $curtime;
User::save_data($user, $user->idx);
}
$user->lacc = $curtime;
User::save_data($user, $user->idx);
@@
-131,9
+132,9
@@
function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
$S_load_stat['R_garbage']++;
if (($room = Room::load_data()) == FALSE) {
$S_load_stat['R_garbage']++;
if (($room = Room::load_data()) == FALSE) {
- Room::unlock_data();
+ Room::unlock_data(
$sem
);
ignore_user_abort(FALSE);
ignore_user_abort(FALSE);
- return (
unrecerror(
));
+ return (
blocking_error(TRUE
));
}
log_main("pre garbage_manager TRE");
$room->garbage_manager(FALSE);
}
log_main("pre garbage_manager TRE");
$room->garbage_manager(FALSE);
@@
-180,7
+181,7
@@
function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
ignore_user_abort(FALSE);
if ($user == FALSE) {
ignore_user_abort(FALSE);
if ($user == FALSE) {
- return (
unrecerror(
));
+ return (
blocking_error(TRUE
));
}
}
}
}
@@
-196,7
+197,11
@@
function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
*/
ignore_user_abort(TRUE);
$sem = Room::lock_data();
*/
ignore_user_abort(TRUE);
$sem = Room::lock_data();
- $room = Room::load_data();
+ if (($room = Room::load_data()) == FALSE) {
+ Room::unlock_data($sem);
+ ignore_user_abort(FALSE);
+ return (blocking_error(TRUE));
+ }
$S_load_stat['R_minusone']++;
/* unset the $user var to reload it from main structure */
$S_load_stat['R_minusone']++;
/* unset the $user var to reload it from main structure */
@@
-204,7
+209,7
@@
function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
if (($user = $room->get_user($sess, $idx)) == FALSE) {
Room::unlock_data($sem);
ignore_user_abort(FALSE);
if (($user = $room->get_user($sess, $idx)) == FALSE) {
Room::unlock_data($sem);
ignore_user_abort(FALSE);
- return (
unrecerror(
));
+ return (
blocking_error(TRUE
));
}
if ($user->the_end) {
}
if ($user->the_end) {
@@
-282,9
+287,9
@@
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) {
$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);
ignore_user_abort(FALSE);
- return (
unrecerror(
));
+ return (
blocking_error(TRUE
));
}
if ($cur_step < $user->step) {
}
if ($cur_step < $user->step) {
@@
-318,12
+323,17
@@
function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
log_auth($user->sess, "Explicit logout.");
$S_load_stat['R_the_end']++;
log_auth($user->sess, "Explicit logout.");
$S_load_stat['R_the_end']++;
- $room = Room::load_data();
+ if (($room = Room::load_data()) == FALSE) {
+ Room::unlock_data($sem);
+ ignore_user_abort(FALSE);
+ return (blocking_error(TRUE));
+ }
+
unset($user);
if (($user = $room->get_user($sess, $idx)) == FALSE) {
Room::unlock_data($sem);
ignore_user_abort(FALSE);
unset($user);
if (($user = $room->get_user($sess, $idx)) == FALSE) {
Room::unlock_data($sem);
ignore_user_abort(FALSE);
- return (
unrecerror(
));
+ return (
blocking_error(TRUE
));
}
$user->reset();
}
$user->reset();