--- /dev/null
+<html>
+<head>
+<script type="text/javascript" src="xynt/xynt-console.js"></script>
+<!-- <script type="text/javascript">
+window.onload_old = function() {
+ // parent.ifra.contentWindow.location.href = 'winstream_rd.php';
+ window.location.href = 'winstream_rd.php';
+}
+
+</script> -->
+<?php
+function mop_flush()
+{
+ ob_flush();
+ flush();
+}
+
+function main()
+{
+ $s = "";
+ for ($i = 0 ; $i < 4096 ; $i++) {
+ $s .= rand(0,255);
+ }
+ for ($i = 0 ; $i < 300 ; $i++) {
+
+ /* parent.document.getElementById('cont').innerHTML = \"%d\";
+ parent.allmythings = \"%d\"; */
+ if ($i != 350) {
+ printf("<script id=\"hs%d\" type=\"text/javascript\">
+ parent.allmythings = %d;
+ console.log(\"zorro \"+parent.allmythings);
+
+ </script>", $i, $i);
+ }
+ else {
+ printf("<script id=\"hs%d\" type=\"text/javascript\">
+ parent.allmythings = %d;
+ console.log(\"zorro \"+parent.allmythings);
+ parent.document.location.assign('winstream2.php');
+ </script>", $i, $i);
+ }
+ if ($i == 0)
+ printf("<!-- %s -->", $s);
+ mop_flush();
+ usleep(1000000);
+ }
+}
+main();
+?>
+</head>
+<body>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<html>
+<head>
+<script type="text/javascript" src="xynt/xynt-commons.js"></script>
+<script type="text/javascript" src="xynt/xynt-console.js"></script>
+<script type="text/javascript" src="xynt/xynt-http-streaming.js"></script>
+<script type="text/javascript"><!--
+var allmythings="BEGIN";
+
+window.onload = function () {
+ var hs;
+
+ hs = new http_streaming(document);
+ hs.start('test-hs-rd.php');
+}
+
+//-->
+</script>
+<body>
+<div id="cont">INIT</div>
+</body>
+</html>
--- /dev/null
+function http_streaming(doc)
+{
+ this.doc = doc;
+ this.keepalive_old = -1;
+ this.keepalive_new = -1;
+ this.keepalives_equal = 0;
+ this.ifra = doc.createElement("iframe");
+ this.ifra.style.visibility = "hidden";
+ doc.body.appendChild(this.ifra);
+ // this.ifra.contentWindow.onload = function () {
+ // this.ifra.contentWindow.location.href = 'winstream_rdxxx.php';
+ // }
+
+}
+
+http_streaming.prototype = {
+ doc: null,
+ ifra: null,
+ keepalive_old: -1,
+ keepalive_new: -1,
+ keepalives_equal: 0,
+ keepalives_eq_max: 6,
+
+ start: function(page) {
+ this.ifra.contentWindow.location.href = page;
+ },
+
+ watchdog: function () {
+ /* +this.keepalives_equal */
+ console.log("watchdog ");
+ if (this.keepalive_old == this.keepalive_new) {
+ this.keepalives_equal++;
+ }
+ else {
+ this.keepalives_equal = 0;
+ }
+
+ if (this.keepalives_equal > this.keepalives_eq_max) {
+ console.log("MAX ACHIEVED "+this.keepalives_equal);
+ }
+ else {
+ setTimeout(function(obj) { obj.watchdog() }, 2000, this);
+ }
+ },
+
+ keepalive: function () {
+ this.keepalive_new++;
+ }
+
+}
\ No newline at end of file