curl_multi_get_handles: get easy handles from a multi handle

Closes #11750
This commit is contained in:
Daniel Stenberg 2023-09-25 17:08:41 +02:00
parent bb4032a152
commit 9ffd411735
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 113 additions and 1 deletions

View file

@ -3788,3 +3788,21 @@ unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi)
DEBUGASSERT(multi);
return multi->max_concurrent_streams;
}
struct Curl_easy **curl_multi_get_handles(struct Curl_multi *multi)
{
struct Curl_easy **a = malloc(sizeof(struct Curl_easy *) *
(multi->num_easy + 1));
if(a) {
int i = 0;
struct Curl_easy *e = multi->easyp;
while(e) {
DEBUGASSERT(i < multi->num_easy);
if(!e->internal)
a[i++] = e;
e = e->next;
}
a[i] = NULL; /* last entry is a NULL */
}
return a;
}