From fef7413f3c72ec3b62469726b7884a7f4ea9c481 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sun, 9 Aug 2009 16:38:57 +0000 Subject: [PATCH] -Improve performance of web ui when dealing with large xcat responses git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3975 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/lib/functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-UI/lib/functions.php b/xCAT-UI/lib/functions.php index a08be7a94..fe04db9d9 100644 --- a/xCAT-UI/lib/functions.php +++ b/xCAT-UI/lib/functions.php @@ -50,13 +50,15 @@ function submit_request($req, $skipVerify){ if($fp = stream_socket_client('ssl://'.$xcathost.':'.$port,$errno,$errstr,30,STREAM_CLIENT_CONNECT,$context)){ fwrite($fp,$req->asXML()); // send the xml to xcatd while(!feof($fp)){ // and then read until there is no more - $response .= preg_replace('/\n/','', fgets($fp)); // remove newlines and add it to the response + $recentdata=fgets($fp); + $response .= preg_replace('/\n/','', $recentdata); // remove newlines and add it to the response // Look for the serverdone response $fullpattern = '/\s*\s*<\/serverdone>\s*<\/xcatresponse>/'; $mixedpattern = '/\s*<\/serverdone>.*<\/xcatresponse>/'; + $recentpattern = '/<\/xcatresponse>/'; //$shortpattern = '/\s*<\/serverdone>/'; - if(preg_match($mixedpattern,$response)) { // transaction is done, pkg up the xml and return it + if(preg_match($recentpattern,$recentdata) && preg_match($mixedpattern,$response)) { // transaction is done, pkg up the xml and return it //echo "

", htmlentities($response), "

\n"; // remove the serverdone response and put an xcat tag around the rest $count = 0;