1curl_share_setopt(3) libcurl Manual curl_share_setopt(3)
2
3
4
6 curl_share_setopt - Set options for a shared object
7
9 #include <curl/curl.h>
10
11 CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, param‐
12 eter);
13
15 Set the option to parameter for the given share.
16
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 CURL_LOCK_DATA_SSL_SESSION
62 SSL session IDs will be shared across the easy handles
63 using this shared object. This will reduce the time spent
64 in the SSL handshake when reconnecting to the same
65 server. Note SSL session IDs are reused within the same
66 easy handle by default.
67
68 CURLSHOPT_UNSHARE
69 This option does the opposite of CURLSHOPT_SHARE. It specifies
70 that the specified parameter will no longer be shared. Valid
71 values are the same as those for CURLSHOPT_SHARE.
72
73 CURLSHOPT_USERDATA
74 The parameter allows you to specify a pointer to data that will
75 be passed to the lock_function and unlock_function each time it
76 is called.
77
79 CURLSHE_OK (zero) means that the option was set properly, non-zero
80 means an error occurred as <curl/curl.h> defines. See the libcurl-
81 errors.3 man page for the full list with descriptions.
82
84 curl_share_cleanup(3), curl_share_init(3)
85
86
87
88libcurl 7.10.7 8 Aug 2003 curl_share_setopt(3)