ext/curl: set curl post size using CURLOPT_POSTFIELDSIZE_LARGE - #22842
Conversation
|
@Ayesh do you think it is worth it to create a test for this that posts >2GB? |
|
I have created 2GB+ tests for ext/tidy, so yes I think it make sense to have one. |
|
I've added a test. It would be nice if it could also run on Windows (as that is the one platform that would profit from this), but the test currently relies on fork. I'll look into this some more later. |
|
I've changed the test for a simpler one that posts to caddy. It doesn't test the actual length of the posted content, but it tests the content-length header, which is an indication that curl received the correct length. It takes ~0.5 seconds, and takes ~2.5GB of memory. |
| var_dump($response); | ||
|
|
||
| ?> | ||
| --EXPECTF-- |
There was a problem hiding this comment.
nit: no need to bother with EXPECTF here since there is no format specifier.
|
also I think it is worth adding a NEWS entry ;) |
This is a 64-bit number on all platforms. This improves support of posting files larger than 2GB. - https://curl.se/libcurl/c/CURLOPT_POSTFIELDSIZE.html - https://curl.se/libcurl/c/CURLOPT_POSTFIELDSIZE_LARGE.html
The test (curl_post_large_string) posts data slightly bigger than fits in a signed 32-bit number. It uses Caddy and not server.inc, because PHP has limits on maximum upload size. It doesn't actually check whether it uploads the correct number of bytes, but it does check the Content-Length header, which is sufficient indication whether curl understands the correct size.
|
Thanks ! |
This is a 64-bit number on all platforms. This improves support of posting files larger than 2GB.