X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_rd.php;h=ec0f47cb08d4635066d8b7c7e3d6fff5c385254d;hb=b4451fb7ba081a9ad657b77f0c5054cf6b54c2bd;hp=5d36e602665643754504d82aec5754dbb3ceebfb;hpb=a69a44d10a54b636d257745d84881d7fa0b34bd5;p=brisk.git diff --git a/web/index_rd.php b/web/index_rd.php index 5d36e60..ec0f47c 100644 --- a/web/index_rd.php +++ b/web/index_rd.php @@ -2,7 +2,7 @@ /* * brisk - index_rd.php * - * Copyright (C) 2006 matteo.nastasi@milug.org + * Copyright (C) 2006-2007 matteo.nastasi@milug.org * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,15 +46,16 @@ function unrecerror() GLOBAL $is_page_streaming; $is_page_streaming = TRUE; - // log_rd2("UNREC_ERROR"); + log_rd2("XXX", "UNREC_ERROR"); return (sprintf('the_end=true; window.onunload = null; document.location.assign("index.php");')); } -function page_sync($page) +function page_sync($sess, $page) { GLOBAL $is_page_streaming; $is_page_streaming = TRUE; + log_rd2($sess, "PAGE_SYNC"); return (sprintf('the_end=true; window.onunload = null; document.location.assign("%s");', $page)); } @@ -74,7 +75,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if (($sem = lock_data()) != FALSE) { // Aggiorna l'expire time lato server if ($first_loop == TRUE) { - log_rd2($sess, "F"); + log_only($sess, "F"); $bri = &load_data(); if (($user = &$bri->get_user($sess, $idx)) == FALSE) { unlock_data($sem); @@ -89,6 +90,8 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su save_data($bri); $first_loop = FALSE; } + + log_only($sess, "U"); unlock_data($sem); ignore_user_abort(FALSE); } @@ -101,13 +104,23 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if ($cur_step == $proxy_step) { log_rd2($sess, "P"); - return; + return (FALSE); } } - if ($bri == FALSE) - $bri = &load_data(); - + if ($bri == FALSE) { + ignore_user_abort(TRUE); + if (($sem = lock_data()) != FALSE) { + log_only($sess, "P"); + $bri = &load_data(); + unlock_data($sem); + ignore_user_abort(FALSE); + } + else { + return (FALSE); + } + } + if (($user = &$bri->get_user($sess, $idx)) == FALSE) { return (unrecerror()); } @@ -188,7 +201,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su $to_stat = $user->stat; unlock_data($sem); ignore_user_abort(FALSE); - return (page_sync($to_stat == "table" ? "table.php" : "index.php")); + return (page_sync($user->sess, $to_stat == "table" ? "table.php" : "index.php")); } log_rd2($sess, "lost history, refresh from scratch"); $new_step = -1; @@ -250,6 +263,10 @@ $is_page_streaming = ((stristr($HTTP_USER_AGENT, "linux") && header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past +if (!isset($myfrom)) + $myfrom = ""; +if (!isset($subst)) + $subst = ""; log_rd2($sess, "FROM OUTSIDE - STAT: ".$stat." SUBST: ".$subst." STEP: ".$step." MYFROM: ".$myfrom. "IS_PAGE:" . $is_page_streaming);