Ticket #9998: 9998.diff
| File 9998.diff, 3.6 KB (added by dd32, 3 years ago) |
|---|
-
wp-includes/http.php
73 73 * Tests all of the objects and returns the object that passes. Also caches 74 74 * that object to be used later. 75 75 * 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 most78 * overhead in its implementation. There isn't any real way around it, since79 * redirects have to be supported, much the same way the other transports80 * 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. 81 81 * 82 82 * There are currently issues with "localhost" not resolving correctly with 83 83 * DNS. This may cause an error "failed to open stream: A connection attempt … … 98 98 if ( true === WP_Http_ExtHttp::test($args) ) { 99 99 $working_transport['exthttp'] = new WP_Http_ExtHttp(); 100 100 $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']; 104 104 } else if ( true === WP_Http_Streams::test($args) ) { 105 105 $working_transport['streams'] = new WP_Http_Streams(); 106 106 $blocking_transport[] = &$working_transport['streams']; 107 107 } else if ( true === WP_Http_Fopen::test($args) ) { 108 108 $working_transport['fopen'] = new WP_Http_Fopen(); 109 109 $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']; 113 113 } 114 114 115 115 foreach ( array('curl', 'streams', 'fopen', 'fsockopen', 'exthttp') as $transport ) { … … 149 149 if ( true === WP_Http_ExtHttp::test($args) ) { 150 150 $working_transport['exthttp'] = new WP_Http_ExtHttp(); 151 151 $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']; 152 158 } else if ( true === WP_Http_Curl::test($args) ) { 153 159 $working_transport['curl'] = new WP_Http_Curl(); 154 160 $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'];161 161 } 162 162 163 163 foreach ( array('curl', 'streams', 'fsockopen', 'exthttp') as $transport ) {
