Merge "Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 4 Sep 2019 03:00:09 +0000 (03:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 4 Sep 2019 03:00:09 +0000 (03:00 +0000)
includes/libs/http/MultiHttpClient.php

index 6b1ef89..17352f0 100644 (file)
@@ -353,9 +353,7 @@ class MultiHttpClient implements LoggerAwareInterface {
                        }
                        curl_setopt( $ch, CURLOPT_READFUNCTION,
                                function ( $ch, $fd, $length ) {
-                                       $data = fread( $fd, $length );
-                                       $len = strlen( $data );
-                                       return $data;
+                                       return (string)fread( $fd, $length );
                                }
                        );
                } elseif ( $req['method'] === 'POST' ) {