curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: curl_mime_data_cb() with curl_easy_duphandle()

From: Christoph M. Becker via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 7 Jan 2020 18:36:57 +0100

On 07.01.2020 at 16:54, Daniel Stenberg wrote:

> On Tue, 7 Jan 2020, Christoph M. Becker wrote:
>
>> I could pass in a CURL handle pointer, but if that CURL handle is
>> later duplicated with curl_easy_duphandle(), both handles would share
>> the same structure, which still holds the original CURL handle.  In
>> other words, whenever readfunc, seekfunc or freefunc set via
>> curl_mime_data_cb() is called, the functions get the same custom arg
>> for all duplicated handles.
>
> How else would you have it work?

It might have been useful (for me) if the three callback functions had
an additional parameter for the CURL handle.

>> wrt. duplicated handles and potentially asynchronous execution
>> (curl_multi_perform()) it is necessary to actually rebuild the whole
>> mime structure when a handle is duplicated, and to set this as
>> CURLOPT_MIMEPOST for the duplicated handle.
>
> That should be a doable way, yes.

Indeed, it looks that way. :)

Thanks!

--
Christoph M. Becker
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-01-07