From f152ed51e1e95583640afb3351128f961305e7bc Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 3 Aug 2008 21:01:28 +0000 Subject: [PATCH] Timeout in WP_Http_Streams::request causes Fatal error abort. Props wet. fixes #7465 see #4779 git-svn-id: http://svn.automattic.com/wordpress/trunk@8528 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/http.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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') );