@@ -237,7 +237,7 @@ public function request(string $method, string $url, array $options = []): Respo
237237
238238 if (!\is_string ($ body )) {
239239 if (\is_resource ($ body )) {
240- $ curlopts [\CURLOPT_INFILE ] = $ body ;
240+ $ curlopts [\CURLOPT_READDATA ] = $ body ;
241241 } else {
242242 $ curlopts [\CURLOPT_READFUNCTION ] = static function ($ ch , $ fd , $ length ) use ($ body ) {
243243 static $ eof = false ;
@@ -316,6 +316,9 @@ public function request(string $method, string $url, array $options = []): Respo
316316 }
317317
318318 foreach ($ curlopts as $ opt => $ value ) {
319+ if (\CURLOPT_INFILESIZE === $ opt && $ value >= 1 << 31 ) {
320+ $ opt = 115 ; // 115 === CURLOPT_INFILESIZE_LARGE, but it's not defined in PHP
321+ }
319322 if (null !== $ value && !curl_setopt ($ ch , $ opt , $ value ) && \CURLOPT_CERTINFO !== $ opt && (!\defined ('CURLOPT_HEADEROPT ' ) || \CURLOPT_HEADEROPT !== $ opt )) {
320323 $ constantName = $ this ->findConstantName ($ opt );
321324 throw new TransportException (sprintf ('Curl option "%s" is not supported. ' , $ constantName ?? $ opt ));
@@ -472,7 +475,7 @@ private function validateExtraCurlOptions(array $options): void
472475 \CURLOPT_RESOLVE => 'resolve ' ,
473476 \CURLOPT_NOSIGNAL => 'timeout ' ,
474477 \CURLOPT_HTTPHEADER => 'headers ' ,
475- \CURLOPT_INFILE => 'body ' ,
478+ \CURLOPT_READDATA => 'body ' ,
476479 \CURLOPT_READFUNCTION => 'body ' ,
477480 \CURLOPT_INFILESIZE => 'body ' ,
478481 \CURLOPT_POSTFIELDS => 'body ' ,
0 commit comments