From: Matteo Nastasi Date: Mon, 30 Jul 2012 07:42:00 +0000 (+0200) Subject: use PageFlush to close session-less index_rd_ifra request X-Git-Tag: v4.0.0~78 X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=84d41583aa4fcd9abfc89f97a6d655877ab6a198 use PageFlush to close session-less index_rd_ifra request --- diff --git a/web/spush/brisk-spush.php b/web/spush/brisk-spush.php index 28088f3..db8724e 100755 --- a/web/spush/brisk-spush.php +++ b/web/spush/brisk-spush.php @@ -243,10 +243,14 @@ function main() $header_out = array(); if (!isset($cookie['sess']) || (($user = $room->get_user($cookie['sess'], $idx)) == FALSE)) { - $body = index_rd_ifra_fini(TRUE); - fwrite($new_socket, headers_render($header_out).$body); - fflush($new_socket); - fclose($new_socket); + $content = index_rd_ifra_fini(TRUE); + + $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; } // close a previous opened index_read_ifra socket, if exists