1curl_share_init(3) libcurl Manual curl_share_init(3)
2
3
4
6 curl_share_init - Create a shared object
7
9 #include <curl/curl.h>
10
11 CURLSH *curl_share_init();
12
14 This function returns a pointer to a CURLSH handle to be used as input
15 to all the other share-functions, sometimes referred to as a share han‐
16 dle in some places in the documentation. This init call MUST have a
17 corresponding call to curl_share_cleanup(3) when all operations using
18 the share are complete.
19
20 This share handle is what you pass to curl using the CURLOPT_SHARE(3)
21 option with curl_easy_setopt(3), to make that specific curl handle use
22 the data in this share.
23
25 CURLSHcode sh;
26 share = curl_share_init();
27 sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
28 if(sh)
29 printf("Error: %s\n", curl_share_strerror(sh));
30
32 Added in 7.10
33
35 If this function returns NULL, something went wrong (out of memory,
36 etc.) and therefore the share object was not created.
37
39 curl_share_cleanup(3), curl_share_setopt(3)
40
41
42
43libcurl 8.0.1 January 02, 2023 curl_share_init(3)