git-svn-id: http://svn.automattic.com/wordpress/trunk@8528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5ac3c72c22
commit
f152ed51e1
|
@ -623,7 +623,8 @@ class WP_Http_Streams {
|
||||||
'user-agent' => $headers['User-Agent'],
|
'user-agent' => $headers['User-Agent'],
|
||||||
'max_redirects' => $r['redirection'],
|
'max_redirects' => $r['redirection'],
|
||||||
'protocol_version' => (float) $r['httpversion'],
|
'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);
|
$handle = fopen($url, 'r', false, $context);
|
||||||
|
|
||||||
stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $r['timeout']) );
|
|
||||||
|
|
||||||
if ( ! $handle)
|
if ( ! $handle)
|
||||||
return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
|
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'] ) {
|
if ( ! $r['blocking'] ) {
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
return array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') );
|
return array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') );
|
||||||
|
|
Loading…
Reference in New Issue