Index: http.php
===================================================================
--- http.php	(revision 8522)
+++ http.php	(working copy)
@@ -88,10 +88,12 @@
 		static $working_transport;
 
 		if ( is_null($working_transport) ) {
-			if ( true === WP_Http_Streams::test() )
-				$working_transport = new WP_Http_Streams();
-			else if ( true === WP_Http_ExtHttp::test() )
+			if ( true === WP_Http_ExtHttp::test() )
 				$working_transport = new WP_Http_ExtHttp();
+			else if ( true === WP_Http_Curl::test() )
+				$working_transport = new WP_Http_Curl();
+			else if ( true === WP_Http_Streams::test() )
+				$working_transport = new WP_Http_Streams();
 			else if ( true === WP_Http_Fopen::test() )
 				$working_transport = new WP_Http_Fopen();
 			else if ( true === WP_Http_Fsockopen::test() )
@@ -119,10 +121,10 @@
 		static $working_transport;
 
 		if ( is_null($working_transport) ) {
-			if ( true === WP_Http_Streams::test() )
-				$working_transport = new WP_Http_Streams();
-			else if ( true === WP_Http_ExtHttp::test() )
+			if ( true === WP_Http_ExtHttp::test() )
 				$working_transport = new WP_Http_ExtHttp();
+			else if ( true === WP_Http_Streams::test() )
+				$working_transport = new WP_Http_Streams();
 			else if ( true === WP_Http_Fsockopen::test() )
 				$working_transport = new WP_Http_Fsockopen();
 		}
@@ -193,7 +195,7 @@
 		if ( ! isset($headers['user-agent']) || ! isset($headers['User-Agent']) )
 			$headers['user-agent'] = $r['user-agent'];
 
-		if ( is_null($body) || count($headers) > 1 )
+		if ( is_null($body) )
 			$transport = WP_Http::_getTransport();
 		else
 			$transport = WP_Http::_postTransport();
@@ -313,15 +315,10 @@
 	/**
 	 * Transform header string into an array.
 	 *
-	 * If an array is given, then it will be immediately passed through with no
-	 * changes. This is to prevent overhead in processing headers that don't
-	 * need to be processed. That and it is unknown what kind of effect
-	 * processing the array will have since there is no checking done on whether
-	 * ':' does not exist within the array string.
+	 * If an array is given then it is assumed to be raw header data with
+	 * numeric keys with the headers as the values. No headers must be passed
+	 * that were already processed.
 	 *
-	 * Checking could be added, but it is easier and faster to just passed the
-	 * array through and assume that it has already been processed.
-	 *
 	 * @access public
 	 * @static
 	 * @since 2.7
@@ -330,11 +327,9 @@
 	 * @return array Processed string headers 
 	 */
 	function processHeaders($headers) {
-		if ( is_array($headers) )
-			return $headers;
+		if ( is_string($headers) )
+			$headers = explode("\n", str_replace(array("\r\n", "\r"), "\n", $headers) );
 
-		$headers = explode("\n", str_replace(array("\r\n", "\r"), "\n", $headers) );
-
 		$response = array('code' => 0, 'message' => '');
 
 		$newheaders = array();
@@ -342,6 +337,7 @@
 			if ( empty($tempheader) )
 				continue;
 
+			
 			if ( false === strpos($tempheader, ':') ) {
 				list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3);
 				$response['code'] = $iResponseCode;
@@ -560,9 +556,11 @@
 		} else {
 			$theHeaders = $http_response_header;
 		}
-		$processedHeaders = WP_Http::processHeaders($theHeaders);
 
 		fclose($handle);
+
+		$processedHeaders = WP_Http::processHeaders($theHeaders);
+
 		return array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response']);
 	}
 
@@ -762,8 +760,8 @@
 		$theHeaders = WP_Http::processHeaders($theHeaders);
 
 		$theResponse = array();
-		$theResponse['response']['code'] = $info['response_code'];
-		$theResponse['response']['message'] = get_status_header_desc($info['response_code']);
+		$theResponse['code'] = $info['response_code'];
+		$theResponse['message'] = get_status_header_desc($info['response_code']);
 
 		return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $theResponse);
 	}
