Make WordPress Core

Changeset 9188


Ignore:
Timestamp:
10/15/2008 08:36:23 PM (17 years ago)
Author:
westi
Message:

Longer default timeouts, more filters and other HTTP changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/http.php

    r9185 r9188  
    184184
    185185        $defaults = array(
    186             'method' => 'GET', 'timeout' => apply_filters('http_request_timeout', 3),
    187             'redirection' => 5, 'httpversion' => '1.0',
    188             'user-agent' => apply_filters('http_headers_useragent', 'WordPress/' . $wp_version ),
     186            'method' => 'GET',
     187            'timeout' => apply_filters( 'http_request_timeout', 5),
     188            'redirection' => apply_filters( 'http_request_redirection_count', 5),
     189            'httpversion' => apply_filters( 'http_request_version', '1.0'),
     190            'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version ),
    189191            'blocking' => true,
    190192            'headers' => array(), 'body' => null
     
    192194
    193195        $r = wp_parse_args( $args, $defaults );
    194 
     196        $r = apply_filters( 'http_request_args', $r );
     197       
    195198        if ( is_null( $r['headers'] ) )
    196199            $r['headers'] = array();
     
    424427    function request($url, $args = array()) {
    425428        $defaults = array(
    426             'method' => 'GET', 'timeout' => 3,
     429            'method' => 'GET', 'timeout' => 5,
    427430            'redirection' => 5, 'httpversion' => '1.0',
    428431            'blocking' => true,
     
    598601
    599602        $defaults = array(
    600             'method' => 'GET', 'timeout' => 3,
     603            'method' => 'GET', 'timeout' => 5,
    601604            'redirection' => 5, 'httpversion' => '1.0',
    602605            'blocking' => true,
     
    692695    function request($url, $args = array()) {
    693696        $defaults = array(
    694             'method' => 'GET', 'timeout' => 3,
     697            'method' => 'GET', 'timeout' => 5,
    695698            'redirection' => 5, 'httpversion' => '1.0',
    696699            'blocking' => true,
     
    816819    function request($url, $args = array()) {
    817820        $defaults = array(
    818             'method' => 'GET', 'timeout' => 3,
     821            'method' => 'GET', 'timeout' => 5,
    819822            'redirection' => 5, 'httpversion' => '1.0',
    820823            'blocking' => true,
     
    833836
    834837        switch ( $r['method'] ) {
    835             case 'GET':
    836                 $r['method'] = HTTP_METH_GET;
    837                 break;
    838838            case 'POST':
    839839                $r['method'] = HTTP_METH_POST;
     
    842842                $r['method'] = HTTP_METH_HEAD;
    843843                break;
     844            case 'GET':
    844845            default:
    845846                $r['method'] = HTTP_METH_GET;
     
    925926    function request($url, $args = array()) {
    926927        $defaults = array(
    927             'method' => 'GET', 'timeout' => 3,
     928            'method' => 'GET', 'timeout' => 5,
    928929            'redirection' => 5, 'httpversion' => '1.0',
    929930            'blocking' => true,
Note: See TracChangeset for help on using the changeset viewer.