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 CURLSH handle to be used as input to all the
15 other share-functions, sometimes referred to as a share handle in some
16 places in the documentation. This init call MUST have a corresponding
17 call to curl_share_cleanup when all operations using the share are com‐
18 plete.
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 7.82.0 January 05, 2022 curl_share_init(3)