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: Dmitry Karpov via curl-library <>
Date: Tue, 29 Aug 2023 22:21:47 +0000

Yes, but I would argue that a simple approach like multi-option clearing all easy handles when it is cleared has its own merits to be considered.
This was the main reason why the iterating over easy handles was requested, and I didn't find any other useful use cases even in the 2016 request that were useful to many people.

If there were such cases, then I think that the requests for easy handle iterating API would pop up much more frequently than just once in seven years.

The iterating API is a good thing for all the other use cases, but using it for freeing easy handles when multi handle is cleaned up as the most frequently used and needed use case,
seems like an overkill to me.

I am not against such API in general if someone wants to use for something else besides freeing easy handles.
But for freeing easy handles when multi handle is cleaned up, I think we should provide an easy and convenient way to do that, maybe in addition to the iterating API.

If freeing easy handles is the most targeted use case, then letting client code to set just one "free easy handle" multi-option in one line
is a much more attractive solution for client code than writing multi-line handle iterating code freeing the handles which needs testing and debugging in each individual client use case.

Dmitry Karpov

-----Original Message-----
From: Daniel Stenberg <>
Sent: Tuesday, August 29, 2023 2:39 PM
To: Dmitry Karpov via curl-library <>
Cc: Dmitry Karpov <>
Subject: RE: [EXTERNAL] Re: Getting a list of easy handles in a multi handle - possible?

On Tue, 29 Aug 2023, Dmitry Karpov via curl-library wrote:

> I think this discussion started from a pretty simple request to close
> and free easy handles that were previously added to a multi-handle
> because the
> curl_multi_cleanup() removes easy handles from the multi-handle but
> doesn't close them.

Jeroen then mentioned a closely related feature request from 2016, and by returning all handles the way we have discussed we can fulfill both requests with the same single API, while your proposal here only satisfies one of them...

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Received on 2023-08-30