From 386fa94983dde1a403adc18267ebe1865e65def5 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Thu, 19 Apr 2012 08:50:18 +0200 Subject: [PATCH] full url bug (ffox 3.5 was affected) for forever iframe streaming fixed --- TODO.stream_iframe | 14 +++++++++++ web/test-hs.php | 4 +--- web/xynt/xynt-commons.js | 41 +++++++++++++++++++++++++++++++++ web/xynt/xynt-http-streaming.js | 4 ++-- 4 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 TODO.stream_iframe diff --git a/TODO.stream_iframe b/TODO.stream_iframe new file mode 100644 index 0000000..e93ec9e --- /dev/null +++ b/TODO.stream_iframe @@ -0,0 +1,14 @@ +- resize the ctx_new var + +ABRT - stop js into iframe when the page is stopped + +DONE - fix "full path problem" + +DONE - clean the DOM at each reload + +DONE - iframe + index_rd that: push forever commands AND watchdog system + +DONE - use watchdog to prevent hang of the stream (reload and full reset of objects) + +DONE - executed commands + diff --git a/web/test-hs.php b/web/test-hs.php index c09c75c..8711ef9 100644 --- a/web/test-hs.php +++ b/web/test-hs.php @@ -23,9 +23,7 @@ window.onload = function () { createCookie('sess', sess, 24*365,cookiepath); gst = new globst(); hs = new http_streaming(window, gst, sess, console); - // FIXME: with relative path not work! - hs.start('http://dodo.birds.lan/xynt/test-hs-rd.php'); - // hs.start('test-hs-rd.php'); + hs.start('test-hs-rd.php'); }; -1) { + rest = parent.substring(p+3); + p2 = rest.indexOf("/"); + if (p2 > -1) { + host = parent.substring(0, p+3+p2); + rest = parent.substring(p+3+p2); + } + else { + host = rest; + rest = ""; + } + } + else { + rest = parent; + } + + // path extraction + p = rest.lastIndexOf("/"); + if (p > -1) { + path = rest.substring(0, p+1); + } + + // alert("host: ["+host+"] path: ["+path+"]"); + if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/') { + return (url); + } + else if (url.substring(0,1) == '/') { + return (host+url); + } + else { + return (host+path+url); + } } \ No newline at end of file diff --git a/web/xynt/xynt-http-streaming.js b/web/xynt/xynt-http-streaming.js index 477e754..a9ccdcd 100644 --- a/web/xynt/xynt-http-streaming.js +++ b/web/xynt/xynt-http-streaming.js @@ -73,9 +73,9 @@ http_streaming.prototype = { this.ifra.style.visibility = "hidden"; this.doc.body.appendChild(this.ifra); if (page != null) - this.page = page; + this.page = url_complete(this.win.location.href, page); this.page = url_append_args(this.page, "sess", this.sess, "st", gst.st); - this.log(this.page); + // this.log("http_streaming::start:this.page "+this.page); this.ifra.contentWindow.location.href = this.page; this.watchdog_ct = 0; this.watchdog_hdl = setTimeout(function(obj) { obj.log("tout1"); obj.watchdog(); }, this.watchdog_timeout, this); -- 2.17.1