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
This commit is contained in:
ryan 2008-08-03 21:01:28 +00:00
parent 5ac3c72c22
commit f152ed51e1
1 changed files with 4 additions and 3 deletions

View File

@ -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') );