X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fxynt_test01.php;h=4c1c43bab19cfbb44071ae5bb3b2afee4a30f431;hb=5770f4664b0b7d2c0ccf37d5ecef614022af0739;hp=7cafda6a49b211d1d72379430ec5e4918e04d04b;hpb=756db36445a1f56b262e54f1c6343c2b57b8fa5b;p=brisk.git
diff --git a/web/xynt_test01.php b/web/xynt_test01.php
index 7cafda6..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,7 +68,8 @@ 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];
@@ -69,7 +77,7 @@ if (!isset($f_test))
$f_test = 1;
if (!isset($f_port))
- $f_port = 80;
+ $f_port = NULL;
if (!isset($f_fback))
$f_fback = 0;
@@ -101,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();
}
@@ -126,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;
@@ -148,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');
@@ -252,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;
}
@@ -278,7 +300,8 @@ if (isset($isstream) && $isstream == "true") {
var gst = new globst();
window.onload = function() {
- 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 = 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();
}
@@ -289,13 +312,13 @@ if (isset($isstream) && $isstream == "true") {