Re: Wrong connection reuse case for Share interface
Daniel Stenberg via curl-library <[email protected]> Thu, 2 Jul 2026 18:19:31 +0200 (CEST)
| Newsgroups | gmane.comp.web.curl.library |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 1 Jul 2026, Dmitry Karpov via curl-library wrote: > * Run the transfer using multi interface to some point where it will be > abandoned (i.e. application may make this decision due to lack of space > where to write incoming data etc) > * Set share to NULL on "abandoned" easy handle to avoid using the share on > that transfer further and remove it from the multi handle (via > curl_multi_remove_handle()). Sharing was not designed to get dynamically modified during transfers. You should remove the easy handle from the multi first, then change sharing options. The CURLOPT_SHARE man page has this wording since a couple of months back: Warning: adding a *share* and then setting it to NULL while the transfer is ongoing is discouraged and may lead to undefined behavior. That said, we can of course add code to handle this specific case better. -- / daniel.haxx.se || https://rock-solid.curl.dev -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html