mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:13:34 +03:00
curl_multi_get_handles: get easy handles from a multi handle
Closes #11750
This commit is contained in:
parent
bb4032a152
commit
9ffd411735
10 changed files with 113 additions and 1 deletions
18
lib/multi.c
18
lib/multi.c
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue