Use curl_mime_*() functions if available#4032
Conversation
As of curl 7.56.0, `curl_formadd()` is deprecated in favor of `curl_mime_*()`, so we use the latter if available.
|
Looks good to me 👍 Good job @cmb69 |
|
@cmb69 a test should be added based on the original report and dealing with multibyte filenames. Thanks. |
| return FAILURE; | ||
| } | ||
| if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK | ||
| || (form_error = curl_mime_filedata(part, ZSTR_VAL(postval))) != CURLE_OK |
There was a problem hiding this comment.
This should be done through a callback, please see @bagder's comment about curl_mime_data_cb. The callback should be integrated with PHP streams. That would not only solve the memory issue with huge files, but also would make diverse streams usable.
Thanks.
Thanks.
|
@weltling, this PR is not about Unicode filepath support, but only about using |
|
Applied as a83b68b. Thanks. |
As of curl 7.56.0,
curl_formadd()is deprecated in favor ofcurl_mime_*(), so we use the latter if available.See also curl/curl#3675 (comment).
/cc @weltling, @adoy