From 2866ca461e9916336ef73fd199210955ab34cbb6 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Wed, 14 Nov 2012 08:19:47 +0100 Subject: [PATCH] htmlfile transport type added --- web/Obj/brisk.phh | 13 +++-- web/Obj/sac-a-push.phh | 4 +- web/briskin5/Obj/briskin5.phh | 10 +++- web/briskin5/index.php | 4 +- web/index.php | 11 ++-- web/xynt-streaming.js | 101 +++++++++++++++++++++++++++++++++- 6 files changed, 125 insertions(+), 18 deletions(-) diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index bb51cb6..2c060d2 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -140,10 +140,10 @@ $mlang_brisk = array( 'btn_backstand'=> array( 'it' => 'torna in piedi', $G_lng = langtolng($G_lang); $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 ); -$G_brisk_version = "4.0.0"; +$G_brisk_version = "4.1.0"; /* MLANG: ALL THE INFO STRINGS IN brisk.phh */ -$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': adottato sac-a-push come motore per l\'invio dei dati in tempo reale.', +$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': adottato sac-a-push come motore per l\'invio dei dati in tempo reale, nuovo trasporto httpfile per explorer.', 'Se vuoi iscriverti alla Mailing List, cliccala!' ), 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: usage of reader/writer locking instead of generic exclusive locking.', 'If you want to subscribe our Mailing List, click it!' ) ); @@ -2138,14 +2138,19 @@ class Room { printf("NEW_SOCKET (root): %d\n", intval($new_socket)); $enc = get_encoding($header); - + if (isset($header['User-Agent']) && strstr($header['User-Agent'], "MSIE")) { + $transp_type = "htmlfile"; + } + else { + $transp_type = "iframe"; + } force_no_cache($header_out); switch ($path) { case "": case "index.php": ob_start(); - index_main($this, $header_out, $addr, $get, $post, $cookie); + index_main($this, $transp_type, $header_out, $addr, $get, $post, $cookie); $content = ob_get_contents(); ob_end_clean(); diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index d582a10..c140192 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -487,13 +487,11 @@ class Sac_a_push { $addr = stream_socket_get_name($new_socket, TRUE); $header_out = array(); - $enc = get_encoding($header); - $subs = SITE_PREFIX."briskin5/"; $subs_l = strlen($subs); $rret = FALSE; if (!strncmp($path, SITE_PREFIX, SITE_PREFIX_LEN)) { - $rret = $this->app->request_mgr($this, $enc, $header_out, $new_socket, substr($path, SITE_PREFIX_LEN), $addr, $get, $post, $cookie); + $rret = $this->app->request_mgr($this, $header, $header_out, $new_socket, substr($path, SITE_PREFIX_LEN), $addr, $get, $post, $cookie); } if ($rret == FALSE) { // FIXME: manage 404 !!! diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index 52cedc5..28ebe2c 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -1392,6 +1392,13 @@ class Bin5 { printf("NEW_SOCKET (root): %d\n", intval($new_socket)); $enc = get_encoding($header); + if (isset($header['User-Agent']) && strstr($header['User-Agent'], "MSIE")) { + $transp_type = "htmlfile"; + } + else { + $transp_type = "iframe"; + } + force_no_cache($header_out); if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE) unset($table_idx); @@ -1399,13 +1406,12 @@ class Bin5 { if (($table_token = gpcs_var('table_token', $get, $post, $cookie)) === FALSE) unset($table_token); - force_no_cache($header_out); switch ($path) { case "": case "index.php": ob_start(); - bin5_index_main($header_out, $addr, $get, $post, $cookie); + bin5_index_main($transp_type, $header_out, $addr, $get, $post, $cookie); $content = ob_get_contents(); ob_end_clean(); diff --git a/web/briskin5/index.php b/web/briskin5/index.php index 00121b8..ca57254 100644 --- a/web/briskin5/index.php +++ b/web/briskin5/index.php @@ -41,7 +41,7 @@ $mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.
Sc ); -function bin5_index_main(&$header_out, $addr, $get, $post, $cookie) +function bin5_index_main($transp_type, &$header_out, $addr, $get, $post, $cookie) { GLOBAL $G_lang, $mlang_bin5_index; if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE) @@ -110,7 +110,7 @@ window.onload = function() { preferences_update(); sess = ""; - xstm = new xynt_streaming(window, 'iframe', null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);}); + xstm = new xynt_streaming(window, "", null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);}); xstm.hbit_set(heartbit); window.onbeforeunload = onbeforeunload_cb; diff --git a/web/index.php b/web/index.php index b3126e3..e716842 100644 --- a/web/index.php +++ b/web/index.php @@ -213,7 +213,7 @@ function carousel_top() return (sprintf('', $rn)); } -function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) +function index_main(&$room, $transp_type, &$header_out, $addr, $get, $post, $cookie) { GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all; GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local; @@ -233,8 +233,7 @@ function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) unset ($table_idx); if (($table_token = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE) unset ($table_token); - - + // Use of proxies isn't allowed. if (!$G_is_local && is_proxy($addr)) { return FALSE; @@ -862,7 +861,7 @@ supported by:
- + @@ -997,7 +996,7 @@ echo "$body"; ?> - + @@ -1057,7 +1056,7 @@ else { ?> sess = ""; -xstm = new xynt_streaming(window, 'iframe', null /* console*/ , gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);}); +xstm = new xynt_streaming(window, "", null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);}); xstm.hbit_set(heartbit); tra = new train($('room_tit')); window.onunload = onunload_cb; diff --git a/web/xynt-streaming.js b/web/xynt-streaming.js index 66227d5..f703aff 100644 --- a/web/xynt-streaming.js +++ b/web/xynt-streaming.js @@ -1,5 +1,96 @@ // old targetpage == page and moved into start method +// +// CLASS transport_htmlfile +// +function transport_htmlfile(doc, page) +{ + this.doc = doc; + this.transfdoc = new ActiveXObject("htmlfile"); + this.transfdoc.open(); + /*this.transfdoc.write("