X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2FMultiHttpClient.php;h=a6135aeb7ae0b8c7a771a2cb96217e0e4495cc43;hp=6ce8f45f3b31d61fd066e26b138ca55081690d00;hb=6568edb9e2e6b3988d8355360fa891ddf06fbdfa;hpb=ebc4d535f196b1d78b6b53cb95cda35d9cb6295e diff --git a/includes/libs/MultiHttpClient.php b/includes/libs/MultiHttpClient.php index 6ce8f45f3b..a6135aeb7a 100644 --- a/includes/libs/MultiHttpClient.php +++ b/includes/libs/MultiHttpClient.php @@ -237,11 +237,9 @@ class MultiHttpClient implements LoggerAwareInterface { } } while ( $mrc == CURLM_CALL_MULTI_PERFORM ); // Wait (if possible) for available work... - if ( $active > 0 && $mrc == CURLM_OK ) { - if ( curl_multi_select( $chm, $selectTimeout ) == -1 ) { - // PHP bug 63411; https://curl.haxx.se/libcurl/c/curl_multi_fdset.html - usleep( 5000 ); // 5ms - } + if ( $active > 0 && $mrc == CURLM_OK && curl_multi_select( $chm, $selectTimeout ) == -1 ) { + // PHP bug 63411; https://curl.haxx.se/libcurl/c/curl_multi_fdset.html + usleep( 5000 ); // 5ms } } while ( $active > 0 && $mrc == CURLM_OK ); } @@ -384,7 +382,7 @@ class MultiHttpClient implements LoggerAwareInterface { curl_setopt( $ch, CURLOPT_HEADERFUNCTION, function ( $ch, $header ) use ( &$req ) { - if ( !empty( $req['flags']['relayResponseHeaders'] ) ) { + if ( !empty( $req['flags']['relayResponseHeaders'] ) && trim( $header ) !== '' ) { header( $header ); } $length = strlen( $header );