1libcurl-share(3)            libcurl share interface           libcurl-share(3)
2
3
4

NAME

6       libcurl-share - how to use the share interface
7

DESCRIPTION

9       This is an overview on how to use the libcurl share interface in your C
10       programs. There are specific man pages for each function  mentioned  in
11       here.
12
13       All functions in the share interface are prefixed with curl_share.
14
15

OBJECTIVES

17       The  share  interface  was added to enable sharing of data between curl
18       "handles".
19

ONE SET OF DATA - MANY TRANSFERS

21       You can have multiple easy handles share data between them.  Have  them
22       update  and  use  the same cookie database or DNS cache! This way, each
23       single transfer will take advantage from data updates made by the other
24       transfer(s).
25

SHARE OBJECT

27       You create a shared object with curl_share_init(3). It returns a handle
28       for a newly created one.
29
30       You tell the shared object what data you want  it  to  share  by  using
31       curl_share_setopt(3).
32
33       Since  you can use this share from multiple threads, and libcurl has no
34       internal thread synchronization, you must provide  mutex  callbacks  if
35       you're  using  this  multi-threaded.  You set lock and unlock functions
36       with curl_share_setopt(3) too.
37
38       Then, you make an easy handle to use  this  share,  you  set  the  CUR‐
39       LOPT_SHARE  option  with curl_easy_setopt(3), and pass in share handle.
40       You can make any number of easy handles share the same share handle.
41
42       To make an easy handle stop using that particular share, you  set  CUR‐
43       LOPT_SHARE  to NULL for that easy handle. To make a handle stop sharing
44       a particular data, you can CURLSHOPT_UNSHARE it.
45
46       When you're done using the share, make sure  that  no  easy  handle  is
47       still using it, and call curl_share_cleanup(3) on the handle.
48

SEE ALSO

50       curl_share_init(3), curl_share_setopt(3), curl_share_cleanup(3)
51
52
53
54libcurl 7.10.7                    8 Aug 2003                  libcurl-share(3)
Impressum