1curl_share_setopt(3)            libcurl Manual            curl_share_setopt(3)
2
3
4

NAME

6       curl_share_setopt - Set options for a shared object
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, param‐
12       eter);
13

DESCRIPTION

15       Set the option to parameter for the given share.
16

OPTIONS

18       CURLSHOPT_LOCKFUNC
19              The parameter must be a pointer to a function matching the  fol‐
20              lowing prototype:
21
22              void    lock_function(CURL    *handle,    curl_lock_data   data,
23              curl_lock_access access, void *userptr);
24
25              data defines what data libcurl wants to lock, and you must  make
26              sure  that  only  one lock is given at any time for each kind of
27              data.
28
29              access defines what access type libcurl wants, shared or single.
30
31              userptr is the pointer you set with CURLSHOPT_USERDATA.
32
33       CURLSHOPT_UNLOCKFUNC
34              The parameter must be a pointer to a function matching the  fol‐
35              lowing prototype:
36
37              void  unlock_function(CURL  *handle,  curl_lock_data  data, void
38              *userptr);
39
40              data defines what data libcurl wants to  unlock,  and  you  must
41              make  sure that only one lock is given at any time for each kind
42              of data.
43
44              userptr is the pointer you set with CURLSHOPT_USERDATA.
45
46       CURLSHOPT_SHARE
47              The parameter specifies a type of data that  should  be  shared.
48              This may be set to one of the values described below.
49
50              CURL_LOCK_DATA_COOKIE
51                     Cookie  data will be shared across the easy handles using
52                     this shared object.
53
54              CURL_LOCK_DATA_DNS
55                     Cached DNS hosts will be shared across the  easy  handles
56                     using  this  shared  object.  Note  that when you use the
57                     multi interface, all easy handles added to the same multi
58                     handle  will share DNS cache by default without this hav‐
59                     ing to be used!
60
61       CURLSHOPT_UNSHARE
62              This option does the opposite of CURLSHOPT_SHARE.  It  specifies
63              that  the  specified  parameter  will no longer be shared. Valid
64              values are the same as those for CURLSHOPT_SHARE.
65
66       CURLSHOPT_USERDATA
67              The parameter allows you to specify a pointer to data that  will
68              be  passed to the lock_function and unlock_function each time it
69              is called.
70

RETURN VALUE

72       CURLSHE_OK (zero) means that the  option  was  set  properly,  non-zero
73       means  an  error  occurred  as  <curl/curl.h> defines. See the libcurl-
74       errors.3 man page for the full list with descriptions.
75

SEE ALSO

77       curl_share_cleanup(3), curl_share_init(3)
78
79
80
81libcurl 7.10.7                    8 Aug 2003              curl_share_setopt(3)
Impressum