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.

Getting a list of easy handles in a multi handle - possible?

From: Richard W.M. Jones via curl-library <curl-library_at_lists.haxx.se>
Date: Sat, 26 Aug 2023 12:05:28 +0100

I was reviewing our latest curl nbdkit plugin, and one remaining issue
is this:

https://gitlab.com/nbdkit/nbdkit/-/blob/201d65063795f492ea86dd8f561dfcab1cd447ac/plugins/curl/worker.c#L68

Basically we have to maintain our own shadow list of the easy handles
that we have added to the multi. The only reason we need to do this
is so that in case we close the plugin early, we can iterate over the
easy handles which are still open and free them.

It seems like the multi "knows" what easy handles it contains already
(multi->easyp), so we shouldn't have to maintain this list ourselves.
However I couldn't see anything in the API to access this.

https://github.com/curl/curl/blob/c2212c05aa99bb31e4b99b0b66fc1747b7d01be6/lib/multihandle.h#L92

Alternatively, could there be an operation which frees up the multi
handle and any also frees the easy handles that it contains?
(curl_multi_cleanup removes the easy handles from the multi, but
doesn't free them.)

https://curl.se/libcurl/c/curl_multi_cleanup.html

Am I missing something or is this something that could be added?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-08-26