From c252b025e1c2da2dc995409491d6ac26180d2254 Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 2 Aug 2011 14:05:56 +0000 Subject: [PATCH] Enable ob_flush(). git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10209 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/lib/functions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-UI/lib/functions.php b/xCAT-UI/lib/functions.php index 6416c4040..b4cceb1ba 100644 --- a/xCAT-UI/lib/functions.php +++ b/xCAT-UI/lib/functions.php @@ -94,6 +94,8 @@ function submit_request($req, $skipVerify, $opts_array){ set_time_limit(900); // Set 15 minutes timeout (for long running requests) // The default is 30 seconds which is too short for some requests + // Turn on output buffering + ob_start(); while(!feof($fp)) { // Read until there is no more // Remove newlines and add it to the response $str = fread($fp, 8192); @@ -109,12 +111,12 @@ function submit_request($req, $skipVerify, $opts_array){ format_TBD($tmp); } else { // Print out output by default - echo $tmp . '
'; + echo '
' . $tmp . '
'; ob_flush(); flush(); } } - } + } } // Look for serverdone response @@ -144,6 +146,9 @@ function submit_request($req, $skipVerify, $opts_array){ } else { echo "

xCAT submit request socket error: $errno - $errstr

"; } + + // Flush (send) the output buffer and turn off output buffering + ob_end_flush(); // Close syslog closelog();