Den sön 27 aug. 2023 kl 10:02 skrev Ray Satiro via curl-library < curl-library@lists.haxx.se>:
> On 8/26/2023 2:27 PM, Daniel Stenberg via curl-library wrote: > > Am I missing something or is this something that could be added? > > > Something like this can absolutely be added, and it might even make a lot > of sense. > > I think I personally would favor an approach that exports the list of easy > handles, or perhaps just a way for an application to iterate over them all, > rather than a more simple "close all easy handles the multi handle knows". > Mostly because providing an iterator opens up for more use cases than > "just" closing down nicely. > > Thoughts? Any proposals for how such an API would look like? > > > How about just return a multi maintained linked list of non-internal easy > handles? > > curl_easy_handles_list *list = curl_multi_get_handles(multi); > > struct curl_easy_handle_list { > CURL *easy; > struct curl_easy_handle_list *next; > }; > wouldn't it be much easier interface to just have a CURL **handles = curl_multi_get_handles(multi); where the last position in *handles would be NULL to indicate the end? Yes it would require libcurl to allocate a list and populate it at the call, but the allocation had to be done in this case anyway and returning a complete list at once avoids the problem with adds/dels during iteration of the list. /HH > > -- > Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library > Etiquette: https://curl.se/mail/etiquette.html >
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html