flush wrapped to be able to do flush and ob_flush
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Mon, 19 Sep 2011 17:25:34 +0000 (19:25 +0200)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.com>
Mon, 28 Nov 2011 22:00:13 +0000 (23:00 +0100)
web/Obj/brisk.phh
web/briskin5/index_rd.php
web/briskin5/statadm.php
web/index_rd.php

index 57f209c..135d299 100644 (file)
@@ -284,6 +284,12 @@ Copyright 2006-2009 <a href=\\"mailto:brisk@alternativeoutput.it\\">Matteo Nasta
 <br><b>version '.$G_brisk_version.'</b><br><br>
 Copyright 2006-2009 <a href=\\"mailto:brisk@alternativeoutput.it\\">Matteo Nastasi</a> (aka mop)<br><br>');
 
+function mop_flush()
+{
+    flush();
+    ob_flush();
+}
+
 function file_lock($fname, $is_exclusive)
 {
     if (($res = fopen($fname, "r+")) == FALSE) {
index aa8bfa9..01e7ab3 100644 (file)
@@ -423,8 +423,8 @@ for ($i = 0 ; time() < $endtime ; $i++) {
     echo "$ret";
     echo ' @END@'; 
     log_send("EXT_STEP: ".$ext_step." ENDTIME: [".$endtime."] ".$ret);
-    flush();
-    log_mop(0, 'bin::index_rd.php: after flush (begin: '.sprintf("%f", $pre_main).')');
+    mop_flush();
+    log_mop(0, 'bin::index_rd.php: after mop_flush (begin: '.sprintf("%f", $pre_main).')');
     if ($is_page_streaming)
       break;
   }
@@ -436,7 +436,7 @@ for ($i = 0 ; time() < $endtime ; $i++) {
   if (($i % 10) == 0) {
     // log_rd2("TIME: ".time());
     echo '_';
-    flush();
+    mop_flush();
   }
  }
 
index bbde8eb..c634ef6 100644 (file)
@@ -410,10 +410,10 @@ function main()
     GLOBAL $G_dbasetype, $G_alarm_passwd, $pazz;
     
     echo "Inizio.<br>";
-    flush();
+    mop_flush();
     if ($pazz != $G_alarm_passwd) {
         echo "Wrong password<br>";
-        flush();
+        mop_flush();
         exit;
     }
     
@@ -428,7 +428,7 @@ function main()
         echo "Failed.<br>\n";
     
     echo "Fine.\n";
-    flush();
+    mop_flush();
 }
 
 main();
index 9763c9e..9fe7052 100644 (file)
@@ -472,8 +472,8 @@ for ($i = 0 ; time() < $endtime ; $i++) {
     echo "$ret";
     echo ' @END@'; 
     log_send("IS_PAGE: ".($is_page_streaming == TRUE ? "TRUE" : "FALSE")."EXT_STEP: ".$ext_step." ENDTIME: [".$endtime."] ".$ret);
-    flush();
-    log_mop(0, 'index_rd.php: after flush (begin: '.sprintf("%f", $pre_main).')');
+    mop_flush();
+    log_mop(0, 'index_rd.php: after mop_flush (begin: '.sprintf("%f", $pre_main).')');
     if ($is_page_streaming)
       break;
   }
@@ -485,7 +485,7 @@ for ($i = 0 ; time() < $endtime ; $i++) {
   if (($i % 10) == 0) {
     // log_rd2("TIME: ".time());
     echo '_';
-    flush();
+    mop_flush();
   }
  }