1curl_share_init(3)                  libcurl                 curl_share_init(3)
2
3
4

NAME

6       curl_share_init - Create a shared object
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLSH *curl_share_init();
12

DESCRIPTION

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

EXAMPLE

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

AVAILABILITY

32       Added in 7.10
33

RETURN VALUE

35       If  this  function  returns  NULL, something went wrong (out of memory,
36       etc.)  and therefore the share object was not created.
37

SEE ALSO

39       curl_share_cleanup(3), curl_share_setopt(3)
40
41
42
43libcurl 8.2.1                   April 26, 2023              curl_share_init(3)
Impressum