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: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 7 Jan 2020 16:54:25 +0100 (CET)

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?

> 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.

-- 
  / daniel.haxx.se | Get the best commercial curl support there is - from me
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-01-07