centralized space eating string management
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Wed, 31 Oct 2012 17:00:03 +0000 (18:00 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Wed, 31 Oct 2012 17:00:03 +0000 (18:00 +0100)
web/Obj/brisk.phh
web/Obj/user.phh
web/briskin5/Obj/briskin5.phh

index 65e2aba..902bfc3 100644 (file)
@@ -2165,7 +2165,7 @@ class Room {
           do {
               if (!isset($cookie['sess'])
                   || (($user = $this->get_user($cookie['sess'], $idx)) == FALSE)) {
-                  $content = User::stream_fini(TRUE);
+                  $content = User::stream_fini($s_a_p->rndstr, TRUE);
                   
                   $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content);
                   return TRUE;
@@ -2181,7 +2181,7 @@ class Room {
               }
               
               $content = "";
-              $user->stream_init($header_out, $content, $get, $post, $cookie);
+              $user->stream_init($s_a_p->rndstr, $header_out, $content, $get, $post, $cookie);
               
               $response = headers_render($header_out, -1).chunked_content($content);
               $response_l = mb_strlen($response, "ASCII");
index 4bd6d95..2b28adb 100644 (file)
@@ -58,72 +58,6 @@ define('USER_FLAG_TY_DISABLE', 0x800000); // done
 define('RD_ENDTIME_DELTA',  240);
 define('RD_KEEPALIVE_TOUT',   4);
 
-$G_four_rnd_string = 
- "GGZDGDRBXDWFXHGPYAAVDXEKFDUWSTEDTDVXBXQPMZAIFPNLRPTWMJAZRHXTIRNZ"
-."HTZXAUVJDCLXENDCLIZXSSEQQGUADYEKNNANJWEGRUFHPLUNSEROZQJSLMUYNUVG"
-."FPLQAGCMTTGIRRXZFBFQFTRBYPHTWFSXFKHKYBRDAOSOURCMEVGPVXJVUQAOCFPV"
-."OQSUBOYWOZLDGRPQQIBNOTHFUHTCRRZOBCUONAXIYUYCJBFTVNWIITVHBYLNMPWR"
-."LPMMIROZVRUNYXSJSMJINSXGACXDMJAEPNFFAERHVDJELXSPPJWKMNFGVGAPTIMR"
-."VMVMVCLWKMPOAJWZGPSPFEXVNQANXG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IP"
-."FQEVUBULHGESOARVICLMSUSHHTVYLFMLHFGKJNPYIYEMLBAZMLIDDSWRCVFOUSGC"
-."TUQHWTUHRJUZHYQOKTWTLRVOSWRPSYBOBSZHZLRZEIZKKCMLNYICCUTIXNXETTKL"
-."PYIFTUDCMWRQBZDROXTTVTAOOIQHIWOZESRHKPNGNCSHNAVEWUSGOTZCRNFSIXGF"
-."QJUMUFPEZBFPOVGZZDCGDKEODSWAPNDNHVJUQDYLCXWNXSCDFFFPBTDOIZIZLBBP"
-."ZXZYWTTPEUUCKXGBTXAJBAXYLMUVWWGWZYTXTKYVRXSOXOBHERLZJPRDXIQZRQLU"
-."TXCLIJNKIRWMVQEJTLHZIDTNGBOYSULGWUTSYTKGNMGZFWKXCCZXGOQGZNQFZJUK"
-."JMBQPQPZOPYTQMPEFTZUDLIIBZAZSZAPNILMIKMPKXJIRHRQMFSTJKAPIIQWOFYQ"
-."HGANJGJSUGDIENDVEQFEMUJBGMZBPHLOARCVGMUUCHLCDDNKSJSCKYSALUAGUZFN"
-."YVURVLREBESGXPANIDKGLPJZGXLKFKTPEQBQEINOYYZTBMPFBLBKIKVPAPFDKKRZ"
-."YMVUBYCYTRXCIICUPTXKGQOIJSVSWPYVALIROWGVXDXGNSRVZOLEJHNRSUKHNTRJ"
-."LQZQKBEFXYKIPXJRZMQMJKUGCNUKBZBWABPLHMAJJZVBCWOQYCLSGDUKJSTHTVXV"
-."OUGJVADGJWGVNBNXYRZDSNLOZDIQRKOQAKJJDKXRMMTXRVTLOMTETNROPDYNXAGR";
-
 $S_load_stat = array( 'rU_heavy'      => 0,
                       'lL_laccgarb'   => 0,
                       'wU_lacc_upd'   => 0,
@@ -805,10 +739,8 @@ class User {
       return ($ret);
   }  //   function maincheck (...
 
-public static function stream_fini($is_unrecoverable)
+  public static function stream_fini($init_string, $is_unrecoverable)
 {
-    GLOBAL $G_four_rnd_string;
-
     // IF IFRAME THEN:
     $body = "";
     $body .= sprintf("<html>
@@ -822,7 +754,7 @@ window.onload = function () { if (http_streaming != \"ready\") { http_streaming.
 </script>
 </head>
 <body>");
-    $body .= sprintf("<!-- \n%s -->\n", $G_four_rnd_string);
+    $body .= sprintf("<!-- \n%s -->\n", $init_string);
     $body .= sprintf("<script id='hs%d' type='text/javascript'><!--
 push(\"%s\");
 // -->
@@ -842,10 +774,8 @@ push(\"%s\");
    stat
    step
 */
-function stream_init(&$header_out, &$body, $get, $post, $cookie)
+function stream_init($init_string, &$header_out, &$body, $get, $post, $cookie)
 {
-    GLOBAL $G_four_rnd_string;
-
     $curtime = time();
 
     printf("CLASS: [%s] base: [%s]\n", get_class($this), self::base_get());
@@ -883,7 +813,7 @@ window.onload = function () { if (http_streaming != \"ready\") { http_streaming.
 </script> 
 </head>
 <body>");
-    $body .= sprintf("<!-- \n%s -->\n", $G_four_rnd_string);
+    $body .= sprintf("<!-- \n%s -->\n", $init_string);
 
     return TRUE;
 }
@@ -891,8 +821,6 @@ window.onload = function () { if (http_streaming != \"ready\") { http_streaming.
 function stream_main(&$body, $get, $post, $cookie)
 {
     GLOBAL $is_page_streaming, $G_splash_idx;
-    // FIXME: only to test fwrite
-    // GLOBAL $G_four_rnd_string;
 
     $CO_splashdate = "CO_splashdate".$G_splash_idx;
     if (($splashdate = gpcs_var("$CO_splashdate", $get, $post, $cookie)) === FALSE)
index fc3a670..b2aae3f 100644 (file)
@@ -720,10 +720,8 @@ class Bin5_user extends User {
         return ($ret);
     }
 
-public static function stream_fini($is_unrecoverable)
+    public static function stream_fini($init_string, $is_unrecoverable)
 {
-    GLOBAL $G_four_rnd_string;
-
     printf("xXx user::stream_fini\n");
 
     // IF IFRAME THEN:
@@ -739,7 +737,7 @@ window.onload = function () { if (http_streaming != \"ready\") { http_streaming.
 </script>
 </head>
 <body>");
-    $body .= sprintf("<!-- \n%s -->\n", $G_four_rnd_string);
+    $body .= sprintf("<!-- \n%s -->\n", $init_string);
     $body .= sprintf("<script id='hs%d' type='text/javascript'><!--
 push(\"%s\");
 // -->
@@ -1430,7 +1428,7 @@ class Bin5 {
                     || !isset($cookie['sess'])
                     || (($user = $bri->get_user($cookie['sess'], $idx)) == FALSE)) {
 
-                    $content = Bin5_user::stream_fini(TRUE);                    
+                    $content = Bin5_user::stream_fini($s_a_p->rndstr, TRUE);
                     $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content);
 
                     return TRUE;                    
@@ -1445,7 +1443,7 @@ class Bin5 {
                 }
                 
                 $content = "";
-                $user->stream_init($header_out, $content, $get, $post, $cookie);
+                $user->stream_init($s_a_p->rndstr, $header_out, $content, $get, $post, $cookie);
                 $response = headers_render($header_out, -1).chunked_content($content);
                 $response_l = mb_strlen($response, "ASCII");