diff --git a/wp-includes/http.php b/wp-includes/http.php index c293bff782..b08461a188 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -623,7 +623,8 @@ class WP_Http_Streams { 'user-agent' => $headers['User-Agent'], 'max_redirects' => $r['redirection'], 'protocol_version' => (float) $r['httpversion'], - 'header' => $headers + 'header' => $headers, + 'timeout' => $r['timeout'] ) ); @@ -634,11 +635,11 @@ class WP_Http_Streams { $handle = fopen($url, 'r', false, $context); - stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $r['timeout']) ); - if ( ! $handle) return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url)); + stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $r['timeout']) ); + if ( ! $r['blocking'] ) { fclose($handle); return array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') );