WordPress.org

Make WordPress Core

Changeset 11524 for trunk


Ignore:
Timestamp:
06/06/2009 06:51:35 AM (9 years ago)
Author:
azaozz
Message:

Preferred transport: move curl to last position and fockopen to 2nd position due to higher compatibility, props DD32, fixes #9998

File:
1 edited

Legend:

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

    r11450 r11524  
    7474     * that object to be used later.
    7575     *
    76      * The order for the GET/HEAD requests are Streams, HTTP Extension, Fopen,
    77      * and finally Fsockopen. fsockopen() is used last, because it has the most
    78      * overhead in its implementation. There isn't any real way around it, since
    79      * redirects have to be supported, much the same way the other transports
    80      * also handle redirects.
     76     * The order for the GET/HEAD requests are HTTP Extension, FSockopen Streams,
     77     * Fopen, and finally cURL. Whilst Fsockopen has the highest overhead, Its
     78     * used 2nd due to high compatibility with most hosts, The HTTP Extension is
     79     * tested first due to hosts which have it enabled, are likely to work
     80     * correctly with it.
    8181     *
    8282     * There are currently issues with "localhost" not resolving correctly with
     
    9999                $working_transport['exthttp'] = new WP_Http_ExtHttp();
    100100                $blocking_transport[] = &$working_transport['exthttp'];
    101             } else if ( true === WP_Http_Curl::test($args) ) {
    102                 $working_transport['curl'] = new WP_Http_Curl();
    103                 $blocking_transport[] = &$working_transport['curl'];
     101            } else if ( true === WP_Http_Fsockopen::test($args) ) {
     102                $working_transport['fsockopen'] = new WP_Http_Fsockopen();
     103                $blocking_transport[] = &$working_transport['fsockopen'];
    104104            } else if ( true === WP_Http_Streams::test($args) ) {
    105105                $working_transport['streams'] = new WP_Http_Streams();
     
    108108                $working_transport['fopen'] = new WP_Http_Fopen();
    109109                $blocking_transport[] = &$working_transport['fopen'];
    110             } else if ( true === WP_Http_Fsockopen::test($args) ) {
    111                 $working_transport['fsockopen'] = new WP_Http_Fsockopen();
    112                 $blocking_transport[] = &$working_transport['fsockopen'];
     110            } else if ( true === WP_Http_Curl::test($args) ) {
     111                $working_transport['curl'] = new WP_Http_Curl();
     112                $blocking_transport[] = &$working_transport['curl'];
    113113            }
    114114
     
    150150                $working_transport['exthttp'] = new WP_Http_ExtHttp();
    151151                $blocking_transport[] = &$working_transport['exthttp'];
     152            } else if ( true === WP_Http_Fsockopen::test($args) ) {
     153                $working_transport['fsockopen'] = new WP_Http_Fsockopen();
     154                $blocking_transport[] = &$working_transport['fsockopen'];
     155            } else if ( true === WP_Http_Streams::test($args) ) {
     156                $working_transport['streams'] = new WP_Http_Streams();
     157                $blocking_transport[] = &$working_transport['streams'];
    152158            } else if ( true === WP_Http_Curl::test($args) ) {
    153159                $working_transport['curl'] = new WP_Http_Curl();
    154160                $blocking_transport[] = &$working_transport['curl'];
    155             } else if ( true === WP_Http_Streams::test($args) ) {
    156                 $working_transport['streams'] = new WP_Http_Streams();
    157                 $blocking_transport[] = &$working_transport['streams'];
    158             } else if ( true === WP_Http_Fsockopen::test($args) ) {
    159                 $working_transport['fsockopen'] = new WP_Http_Fsockopen();
    160                 $blocking_transport[] = &$working_transport['fsockopen'];
    161161            }
    162162
Note: See TracChangeset for help on using the changeset viewer.