mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	the code change for flush output
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13694 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -64,6 +64,7 @@ function submit_request($req, $skipVerify, $opts_array){
 | 
			
		||||
	$rsp = FALSE;
 | 
			
		||||
	$response = '';
 | 
			
		||||
	$cleanexit = 0;
 | 
			
		||||
        $flushtail = '';
 | 
			
		||||
 | 
			
		||||
	// Determine whether to flush output or not
 | 
			
		||||
	$flush = false;
 | 
			
		||||
@@ -97,7 +98,7 @@ function submit_request($req, $skipVerify, $opts_array){
 | 
			
		||||
 | 
			
		||||
		// Turn on output buffering
 | 
			
		||||
		ob_start();
 | 
			
		||||
		if ($flush) {
 | 
			
		||||
		if ($flush){
 | 
			
		||||
		    echo str_pad('',1024)."\n";
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
@@ -110,14 +111,22 @@ function submit_request($req, $skipVerify, $opts_array){
 | 
			
		||||
 | 
			
		||||
				// Flush output to browser
 | 
			
		||||
				if ($flush) {
 | 
			
		||||
                    $str = $flushtail . $str;
 | 
			
		||||
                    if (preg_match('/[^>]+$/', $str, $matches)){
 | 
			
		||||
                        $flushtail = $matches[0];
 | 
			
		||||
                        $str = preg_replace('/[^>]+$/', '', $str);
 | 
			
		||||
                    }
 | 
			
		||||
                    else{
 | 
			
		||||
                        $flushtail = '';
 | 
			
		||||
                    }
 | 
			
		||||
                    $str = preg_replace('/<errorcode>.*<\/errorcode>/', '', $str);
 | 
			
		||||
					// Strip HTML tags from output
 | 
			
		||||
					$str = preg_replace('/<errorcode>.*<\/errorcode>/', '', $str);
 | 
			
		||||
					if ($tmp = trim(strip_tags($str))) {
 | 
			
		||||
						// Format the output based on what was given for $flush_format
 | 
			
		||||
						if ($flush_format == "TDB") {
 | 
			
		||||
							format_TBD($tmp);
 | 
			
		||||
						} else {
 | 
			
		||||
						    $tmp = preg_replace('/\n\s*/', "\n", $tmp);
 | 
			
		||||
                                                        $tmp = preg_replace('/\n\s*/', "\n", $tmp);
 | 
			
		||||
							// Print out output by default
 | 
			
		||||
							echo '<pre style="font-size: 10px;">' . $tmp . '</pre>';
 | 
			
		||||
							ob_flush();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user