Changeset 10281
- Timestamp:
- 12/30/2008 10:45:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/http.php
r10211 r10281 30 30 * requirement, it will be easy to add the static keyword to the code. It is not 31 31 * as easy to convert a function to a method after enough code uses the old way. 32 * 33 * Debugging includes several actions, which pass different variables for 34 * debugging the HTTP API. 35 * 36 * <strong>http_transport_get_debug</strong> - gives working, nonblocking, and 37 * blocking transports. 38 * 39 * <strong>http_transport_post_debug</strong> - gives working, nonblocking, and 40 * blocking transports. 32 41 * 33 42 * @package WordPress … … 115 124 } 116 125 126 if( has_filter('http_transport_get_debug') ) 127 do_action('http_transport_get_debug', $working_transport, $blocking_transport, $nonblocking_transport); 128 117 129 if ( isset($args['blocking']) && !$args['blocking'] ) 118 130 return $nonblocking_transport; … … 157 169 } 158 170 171 if( has_filter('http_transport_post_debug') ) 172 do_action('http_transport_post_debug', $working_transport, $blocking_transport, $nonblocking_transport); 173 159 174 if ( isset($args['blocking']) && !$args['blocking'] ) 160 175 return $nonblocking_transport; … … 258 273 } 259 274 275 if( has_action('http_api_debug') ) 276 do_action('http_api_debug', $transports, 'transports_list'); 277 260 278 $response = array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') ); 261 279 foreach( (array) $transports as $transport ) { 262 280 $response = $transport->request($url, $r); 263 281 264 if( !is_wp_error($response) ) 282 if( has_action('http_api_debug') ) 283 do_action( 'http_api_debug', $response, 'response', get_class($transport) ); 284 285 if( ! is_wp_error($response) ) 265 286 return $response; 266 287 } … … 410 431 if ( $hasChunk ) { 411 432 if ( empty($match[1]) ) { 412 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') );433 return $body; 413 434 } 414 435 … … 427 448 } 428 449 } else { 429 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') );450 return $body; 430 451 } 431 452 } while ( false === $done ); … … 1019 1040 else 1020 1041 curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 ); 1042 1043 do_action_ref_array( 'http_api_curl', &$handle ); 1021 1044 1022 1045 if ( ! $r['blocking'] ) {
Note: See TracChangeset
for help on using the changeset viewer.