Make WordPress Core

Ticket #7456: http.8524.diff

File http.8524.diff, 951 bytes (added by wet, 18 years ago)
  • http.php

     
    623623                                'user-agent' => $headers['User-Agent'],
    624624                                'max_redirects' => $r['redirection'],
    625625                                'protocol_version' => (float) $r['httpversion'],
    626                                 'header' => $headers
     626                                'header' => $headers,
     627                                'timeout' => $r['timeout']
    627628                        )
    628629                );
    629630
    … …  
    634635
    635636                $handle = fopen($url, 'r', false, $context);
    636637
    637                 stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $r['timeout']) );
    638 
    639638                if ( ! $handle)
    640639                        return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
    641640
     641                stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $r['timeout']) );
     642
    642643                if ( ! $r['blocking'] ) {
    643644                        fclose($handle);
    644645                        return array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') );