Ticket #18738: class-http.php.patch
| File class-http.php.patch, 1.4 KB (added by , 12 years ago) |
|---|
-
wp-includes/class-http.php
1231 1243 1232 1244 // We don't need to return the body, so don't. Just execute request and return. 1233 1245 if ( ! $r['blocking'] ) { 1234 curl_exec( $handle ); 1246 $this->curl_handles[] = $handle; 1247 $this->curl_multi = curl_multi_init(); 1235 1248 1236 if ( $curl_error = curl_error( $handle ) ) { 1237 curl_close( $handle ); 1238 return new WP_Error( 'http_request_failed', $curl_error ); 1249 curl_multi_add_handle( $this->curl_multi, $handle ); 1250 $curl_error = curl_multi_exec( $this->curl_multi, $active ); 1251 add_action( 'shutdown', array( $this, 'close_connections' ) ); 1252 1253 if ( $curl_error !== CURLM_OK ) { 1254 curl_multi_remove_handle( $this->curl_multi, $handle ); 1255 curl_multi_close( $this->curl_multi ); 1256 1257 return new WP_Error( 'http_request_failed', curl_multi_strerror( $curl_error ) ); 1239 1258 } 1240 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {1241 curl_close( $handle );1242 return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );1243 }1244 1259 1245 curl_close( $handle );1246 1260 return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); 1247 1261 } 1248 1262