cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to list easy handles from a multi handle

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 6 Jun 2016 19:02:50 -0400

On 6/3/2016 12:49 PM, Jeroen Ooms wrote:
> On Wed, Jun 1, 2016 at 11:37 PM, Daniel Stenberg<daniel_at_haxx.se> wrote:
>>> >>Is there an easy way to, at any given point, to list all easy-handles
>>> >>which are currently added to the multi handle? Or do we need to keep track
>>> >>of this ourselves?
>> >
>> >There's currently no such way, no. But it sounds like something that I could
>> >agree with being useful! =)
> OK so that's not helping me right now:-) Another approach: is it
> legal to call curl_multi_remove_handle() with an easy handle that was
> already removed earlier from the multi handle? What would be the
> expected response code?
>
> Is it legal to call curl_multi_remove_handle with an easy handle that
> was never added to this multi handle in the first place?

What he was getting at I think is you could propose a patch if you wanted.

If you are in a pinch it's for sure very discouraged to do this but if
you're comfortable with type punning you could access the internal
linked list of easy handles for a multi. I experimented with that this
afternoon. It's an internal structure that may change in the future
though so you'd need to check each version you choose to support. See:
https://gist.github.com/jay/5b68c1bde985b1b2d23f2b583a26e5ad

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-06-07