WordPress.org

Make WordPress Core

Ticket #18738: 18738.patch

File 18738.patch, 1.4 KB (added by johnbillion, 7 years ago)
  • wp-includes/class-http.php

     
    203203         * @return string|false Class name for the first transport that claims to support the request.  False if no transport claims to support the request.
    204204         */
    205205        public function _get_first_available_transport( $args, $url = null ) {
    206                 $request_order = array( 'curl', 'streams', 'fsockopen' );
    207206
     207                if ( isset( $args['blocking'] ) and $args['blocking'] )
     208                        $request_order = array( 'curl', 'streams', 'fsockopen' );
     209                else
     210                        $request_order = array( 'fsockopen', 'curl', 'streams' );
     211
    208212                // Loop over each transport on each HTTP request looking for one which will serve this request's needs
    209213                foreach ( $request_order as $transport ) {
    210214                        $class = 'WP_HTTP_' . $transport;
     
    226230         * Also caches the transport instance to be used later.
    227231         *
    228232         * The order for blocking requests is cURL, Streams, and finally Fsockopen.
    229          * The order for non-blocking requests is cURL, Streams and Fsockopen().
     233         * The order for non-blocking requests is Fsockopen(), cURL and finally Streams.
    230234         *
    231235         * There are currently issues with "localhost" not resolving correctly with DNS. This may cause
    232236         * an error "failed to open stream: A connection attempt failed because the connected party did