forked from curl/curl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
curl_multi_get_handles: get easy handles from a multi handle
Closes curl#11750
- Loading branch information
Showing
10 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.\" ************************************************************************** | ||
.\" * _ _ ____ _ | ||
.\" * Project ___| | | | _ \| | | ||
.\" * / __| | | | |_) | | | ||
.\" * | (__| |_| | _ <| |___ | ||
.\" * \___|\___/|_| \_\_____| | ||
.\" * | ||
.\" * Copyright (C) Daniel Stenberg, <[email protected]>, et al. | ||
.\" * | ||
.\" * This software is licensed as described in the file COPYING, which | ||
.\" * you should have received as part of this distribution. The terms | ||
.\" * are also available at https://curl.se/docs/copyright.html. | ||
.\" * | ||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell | ||
.\" * copies of the Software, and permit persons to whom the Software is | ||
.\" * furnished to do so, under the terms of the COPYING file. | ||
.\" * | ||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
.\" * KIND, either express or implied. | ||
.\" * | ||
.\" * SPDX-License-Identifier: curl | ||
.\" * | ||
.\" ************************************************************************** | ||
.TH curl_multi_get_handles 3 "28 August 2023" "libcurl" "libcurl" | ||
.SH NAME | ||
curl_multi_get_handles - returns all added easy handles | ||
.SH SYNOPSIS | ||
.nf | ||
#include <curl/curl.h> | ||
|
||
CURL **curl_multi_get_handles(CURLM *multi_handle); | ||
.fi | ||
.SH DESCRIPTION | ||
Returns an array with pointers to all added easy handles. The end of the list | ||
is marked with a NULL pointer. | ||
|
||
Even if there is not a single easy handle added, this still returns an array | ||
but with only a single NULL pointer entry. | ||
|
||
The returned array contains all the handles that are present at the time of | ||
the call. As soon as a handle has been removed from or a handle has been added | ||
to the multi handle after the handle array was returned, the two data points | ||
are out of sync. | ||
|
||
The order of the easy handles within the array is not guaranteed. | ||
|
||
The returned array must be freed with a call to \fIcurl_free(3)\fP after use. | ||
.SH EXAMPLE | ||
.nf | ||
/* init a multi stack */ | ||
multi_handle = curl_multi_init(); | ||
|
||
/* add a transfer */ | ||
curl_multi_add_handle(multi_handle, http_handle); | ||
|
||
/* extract all added handles */ | ||
CURL **list = curl_multi_get_handles(multi_handle); | ||
|
||
if(list) { | ||
/* remove all added handles */ | ||
for(i = 0; list[i]; i++) { | ||
curl_multi_remove_handle(multi_handle, list[i]); | ||
} | ||
curl_free(list); | ||
} | ||
.fi | ||
.SH AVAILABILITY | ||
Added in 8.4.0 | ||
.SH RETURN VALUE | ||
Returns NULL on failure. Otherwise it returns a pointer to an allocated array. | ||
.SH "SEE ALSO" | ||
.BR curl_multi_cleanup "(3)," curl_multi_init "(3), " | ||
.BR curl_multi_add_handle "(3), " curl_multi_remove_handle "(3) " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters