From 84d41583aa4fcd9abfc89f97a6d655877ab6a198 Mon Sep 17 00:00:00 2001 From: Matteo Nastasi Date: Mon, 30 Jul 2012 09:42:00 +0200 Subject: [PATCH] use PageFlush to close session-less index_rd_ifra request --- web/spush/brisk-spush.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 -- 2.17.1