From: Matteo Nastasi Date: Wed, 3 Oct 2012 20:20:46 +0000 (+0200) Subject: Merge branch 'sac-a-push' of git.birds.lan:brisk into sac-a-push X-Git-Tag: v4.0.0~47 X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=22d0d66d55607bc8941922fc1bf4d818664abbc2;hp=64fd2be16978dab5d777388423a9d1d74d620cf8;p=brisk.git Merge branch 'sac-a-push' of git.birds.lan:brisk into sac-a-push --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index b52c333..af2a901 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -293,6 +293,13 @@ function mop_flush() flush(); } +function force_no_cache(&$header_out) +{ + $header_out['Pragma'] = 'no-cache, must-revalidate'; + $header_out['Cache-Control'] = 'no-cache'; + $header_out['Expires'] = '-1'; +} + function file_lock($fname, $is_exclusive) { if (($res = @fopen($fname, "r+")) == FALSE) { @@ -2179,6 +2186,8 @@ class Room { $content = ob_get_contents(); ob_end_clean(); + force_no_cache($header_out); + $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content); return TRUE; @@ -2189,6 +2198,8 @@ class Room { $content = ob_get_contents(); ob_end_clean(); + force_no_cache($header_out); + $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content); return TRUE; diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index cd0d6ab..1151ea1 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -284,7 +284,7 @@ class Sac_a_push { } $write = NULL; $except = NULL; - $num_changed_sockets = stream_select($read, $write, $except, 0, 250000); + $num_changed_sockets = stream_select($read, $write, $except, 5, 0); if ($num_changed_sockets == 0) { printf(" no data in 5 secs "); diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index 4fb54b1..c5ad7ce 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -903,6 +903,29 @@ class Bin5 { var $the_end; var $tok; + static function page_manager($room, $header_out, $path, $method, $addr, $get, $post, $cookie) + { + switch ($path) { + case "": + case "index.php": + ob_start(); + bin5_index_main($room, $header_out, $addr, $get, $post, $cookie); + $content = ob_get_contents(); + ob_end_clean(); + + force_no_cache($header_out); + + $pgflush = new PageFlush($new_socket, $curtime, 20, $header_out, $content); + + if ($pgflush->try_flush($curtime) == FALSE) { + // Add $pgflush to the pgflush array + array_push($pages_flush, $pgflush); + } + break; + } + return TRUE; + } + function Bin5 ($room, $table_idx, $table_token) { $this->user = array(); $this->table = array(); @@ -1414,6 +1437,8 @@ class Bin5 { $content = ob_get_contents(); ob_end_clean(); + force_no_cache($header_out); + $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content); return TRUE; @@ -1425,6 +1450,8 @@ class Bin5 { $content = ob_get_contents(); ob_end_clean(); + force_no_cache($header_out); + $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content); return TRUE; diff --git a/web/commons.js b/web/commons.js index f0ea078..99a2983 100644 --- a/web/commons.js +++ b/web/commons.js @@ -249,6 +249,7 @@ function send_mesg(mesg) // alert("xhr_wr: "+xhr_wr+" is_conn: "+is_conn); xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+'mesg='+mesg, (is_conn ? true : false)); + xhr_wr.setRequestHeader("If-Modified-Since", new Date().toUTCString()); xhr_wr.onreadystatechange = function() { return; }; if (typeof(g_debug) == 'number' && g_debug > 0 && typeof(console) == 'object' && typeof(console.log) == 'function') { diff --git a/web/xynt-http-streaming.js b/web/xynt-http-streaming.js index 0cbf36b..7d216aa 100644 --- a/web/xynt-http-streaming.js +++ b/web/xynt-http-streaming.js @@ -39,7 +39,8 @@ http_streaming.prototype = { keepalives_equal: 0, keepalives_eq_max: 6, /* NOTE: right watch_timeout value to 100, for devel reasons use 1000 or more */ - watchdog_timeout: 200, + // FIXME watchdog_timeout: 200, + watchdog_timeout: 2000, watchdog_ct: 0, watchdog_checktm: 20, watchable: false,