From b5a535adf6a1dbcee2c1046d451a99f230aace80 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Wed, 25 Apr 2012 10:54:02 +0200 Subject: [PATCH] ctx_new moved and $st added to manage status value --- web/test-hs-rd.php | 12 +++++++----- web/xynt/xynt-http-streaming-ifra.js | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/web/test-hs-rd.php b/web/test-hs-rd.php index b3030dd..bd4667e 100644 --- a/web/test-hs-rd.php +++ b/web/test-hs-rd.php @@ -4,7 +4,6 @@ @@ -20,6 +19,7 @@ function mop_flush() function main() { + $st = 0; $fp = fopen("/tmp/test-hs-rd.log", "a"); fwrite($fp, "START\n"); fclose($fp); @@ -28,19 +28,21 @@ function main() for ($i = 0 ; $i < 4096 ; $i++) { $s .= rand(65,90); } - for ($i = 0 ; $i < 15 ; $i++) { + + $to = rand(10,20); + for ($first = true, $i = $st+1 ; $i < $st+$to ; $i++, $first = false) { // if ($i == 0) // sleep(1); - if ($i == 8) { + if ($i == $st+8) { // exit(); sleep(30); } printf("", $i, ($i == 0 ? "
" : ""), $i); +", $i, ($first ? "
" : ""), $i); - if ($i == 0) + if ($first) printf("", $s); mop_flush(); usleep(1000000); diff --git a/web/xynt/xynt-http-streaming-ifra.js b/web/xynt/xynt-http-streaming-ifra.js index a854c05..7b4124f 100644 --- a/web/xynt/xynt-http-streaming-ifra.js +++ b/web/xynt/xynt-http-streaming-ifra.js @@ -1,3 +1,5 @@ +var ctx_new = ""; + function push(s) { if (s != null) { ctx_new += "@BEGIN@"+s+"@END@"; -- 2.17.1