Timeout in WP_Http_Streams::request causes Fatal error abort. Props wet. fixes #7465 see #4779

git-svn-id: https://develop.svn.wordpress.org/trunk@8528 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-08-03 21:01:28 +00:00
parent 5e982913b6
commit 53de042ebd
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') );