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: Getting a list of easy handles in a multi handle - possible?

From: Timothe Litt <litt_at_acm.org>
Date: Sat, 26 Aug 2023 15:08:20 -0400


On 26-Aug-23 15:05, Daniel Stenberg via curl-library wrote:
> On Sat, 26 Aug 2023, Jeroen Ooms wrote:
>
>> I am also (still) interested: https://curl.se/mail/lib-2016-06/0002.html
>
> Seven years later, what do you know! At least I was positive about it
> already back then.
>
> How about something basic like this?
>
> /*
>  * Returns an easy handle from the multi handle
>  *
>  * If 'prev' is NULL, return the first.
>  * If 'prev' is not NULL:
>  *  - if 'prev' identifies a handle in the multi handle, return the next
>  *  - if 'prev' is not a handle present in the multi, return the first
>  *
>  * Returns NULL if the above has no handle to return.
>  */
> CURL *curl_multi_easy(CURLM *multi, CURL *prev);
>
Not very efficient if there are lots of handles.  You will scan the list
O(n^2) looking for prev each time - or, I suppose create a hash.



Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-08-26