@@ -237,7 +237,7 @@ public function request(string $method, string $url, array $options = []): Respo
237
237
238
238
if (!\is_string ($ body )) {
239
239
if (\is_resource ($ body )) {
240
- $ curlopts [\CURLOPT_INFILE ] = $ body ;
240
+ $ curlopts [\CURLOPT_READDATA ] = $ body ;
241
241
} else {
242
242
$ curlopts [\CURLOPT_READFUNCTION ] = static function ($ ch , $ fd , $ length ) use ($ body ) {
243
243
static $ eof = false ;
@@ -316,6 +316,9 @@ public function request(string $method, string $url, array $options = []): Respo
316
316
}
317
317
318
318
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
+ }
319
322
if (null !== $ value && !curl_setopt ($ ch , $ opt , $ value ) && \CURLOPT_CERTINFO !== $ opt && (!\defined ('CURLOPT_HEADEROPT ' ) || \CURLOPT_HEADEROPT !== $ opt )) {
320
323
$ constantName = $ this ->findConstantName ($ opt );
321
324
throw new TransportException (sprintf ('Curl option "%s" is not supported. ' , $ constantName ?? $ opt ));
@@ -472,7 +475,7 @@ private function validateExtraCurlOptions(array $options): void
472
475
\CURLOPT_RESOLVE => 'resolve ' ,
473
476
\CURLOPT_NOSIGNAL => 'timeout ' ,
474
477
\CURLOPT_HTTPHEADER => 'headers ' ,
475
- \CURLOPT_INFILE => 'body ' ,
478
+ \CURLOPT_READDATA => 'body ' ,
476
479
\CURLOPT_READFUNCTION => 'body ' ,
477
480
\CURLOPT_INFILESIZE => 'body ' ,
478
481
\CURLOPT_POSTFIELDS => 'body ' ,
0 commit comments