X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fxynt_test01.php;h=4c1c43bab19cfbb44071ae5bb3b2afee4a30f431;hb=7ee4d75003cb32207ffdb3cf16b1644039578945;hp=c0aa0585cac4ed3bf0198de9b229f21038cd5656;hpb=ddd822f1dca51731cc9fc8199db3f1cc527fb01a;p=brisk.git diff --git a/web/xynt_test01.php b/web/xynt_test01.php index c0aa058..4c1c43b 100644 --- a/web/xynt_test01.php +++ b/web/xynt_test01.php @@ -1,11 +1,18 @@ il client aspetta 3 secondi, e poi da 10 a N ogni secondo, (status sempre verde)."); + "Reload limiter: da 1 a 8 ogni secondo e chiude, 9 setta e chiude subito,
il client aspetta 3 secondi, e poi da 10 a N ogni secondo, (status sempre verde).", + "Esegue un comando, manda loc_new a un valore irraggiungibile, stoppa il processore di comandi e poi dà un comando teoricamente irraggiungibile."); // trim(mb_convert_case($split[0], MB_CASE_TITLE, 'UTF-8')) @@ -61,13 +68,20 @@ function headers_render($header, $len) return (TRUE); } -$transs = array( "iframe", "websocket", "xhr", "htmlfile" ); +$transs = array( "iframe", "websocket", "websocketsec", "xhr", "htmlfile" ); +$trans_ports = array( "iframe"=>80, "websocket"=>80, "websocketsec"=>443, "xhr"=>80, "htmlfile"=>80 ); if (!isset($f_trans)) $f_trans = $transs[0]; if (!isset($f_test)) $f_test = 1; +if (!isset($f_port)) + $f_port = NULL; + +if (!isset($f_fback)) + $f_fback = 0; + function mop_flush() { @@ -95,12 +109,14 @@ function xcape($s) } if (isset($isstream) && $isstream == "true") { - require_once("Obj/transports.phh"); if (isset($transp) && $transp == "websocket") { $trobj = new Transport_websocket(); } + else if (isset($transp) && $transp == "websocketsec") { + $trobj = new Transport_websocket(TRUE); + } else if (isset($transp) && $transp == "xhr") { $trobj = new Transport_xhr(); } @@ -120,6 +136,7 @@ if (isset($isstream) && $isstream == "true") { $init_string .= chr(mt_rand(65, 90)); } $headers_in = getallheaders(); + // error_log(print_r($headers_in, TRUE)); $headers = array(); foreach ($headers_in as $header_in => $value) { $headers[mb_convert_case($header_in, MB_CASE_TITLE, 'UTF-8')] = $value; @@ -142,7 +159,7 @@ if (isset($isstream) && $isstream == "true") { fclose($fp); } - if (isset($transp) && $transp == "websocket") { + if (isset($transp) && ($transp == "websocket" || $transp == "websocketsec")) { header_remove('Connection'); header_remove('Content-Encoding'); header_remove('Content-Type'); @@ -246,6 +263,17 @@ if (isset($isstream) && $isstream == "true") { sleep(1); } } + break; + case 7: + $chunk = $trobj->chunk(1, sprintf("gst.st++; \$('container').innerHTML = 'prima';")); + print($chunk); + + $chunk = $trobj->chunk(2, sprintf("gst.st++; gst.st_loc_new++; xstm.stop();")); + print($chunk); + + $chunk = $trobj->chunk(3, sprintf("gst.st++; \$('container').innerHTML = 'dopo';")); + print($chunk); + break; } @@ -272,7 +300,8 @@ if (isset($isstream) && $isstream == "true") { var gst = new globst(); window.onload = function() { - xstm = new xynt_streaming(window, "", 80, 0, null /* console */, gst, 'xynt_test01_php', 'sess', sess, null, 'xynt_test01.php?isstream=true&f_test=', function(com){eval(com);}); + xstm = new xynt_streaming(window, "", , , console, gst, 'xynt_test01_php', 'sess', sess, null, 'xynt_test01.php?isstream=true&f_test=', function(com){eval(com);}); xstm.hbit_set(heartbit); xstm.start(); } @@ -283,16 +312,17 @@ if (isset($isstream) && $isstream == "true") {
"); for ($test = 1 ; $test <= count($desc) ; $test++) { printf(""); foreach ($transs as $trans) { - printf("Test %s %02d", $trans, $test, $trans, $test); + printf("Test %s %02d (port %d (fb %d))", $trans, $test, + ($f_port == NULL ? "" : sprintf("&f_port=%d", $f_port)), $f_fback, $trans, $test, + ($f_port == NULL ? $trans_ports[$trans] : $f_port ), $f_fback); } printf("\n"); } +printf("STOP", count($transs)); printf(""); printf("
[%s]
Test: %d
", $f_trans, $f_test); ?>