Git init
[external/curl.git] / docs / libcurl / libcurl-share.html
1 <html><head>
2 <title>libcurl-share man page</title>
3 <meta name="generator" content="roffit 0.7">
4 <STYLE type="text/css">
5 P.level0 {
6  padding-left: 2em;
7 }
8
9 P.level1 {
10  padding-left: 4em;
11 }
12
13 P.level2 {
14  padding-left: 6em;
15 }
16
17 span.emphasis {
18  font-style: italic;
19 }
20
21 span.bold {
22  font-weight: bold;
23 }
24
25 span.manpage {
26  font-weight: bold;
27 }
28
29 h2.nroffsh {
30  background-color: #e0e0e0;
31 }
32
33 span.nroffip {
34  font-weight: bold;
35  font-size: 120%;
36  font-family: monospace;
37 }
38
39 p.roffit {
40  text-align: center;
41  font-size: 80%;
42 }
43 </STYLE>
44 </head><body>
45
46 <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
47 <p class="level0">libcurl-share - how to use the share interface <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
48 <p class="level0">This is an overview on how to use the libcurl share interface in your C programs. There are specific man pages for each function mentioned in here. 
49 <p class="level0">All functions in the share interface are prefixed with curl_share. 
50 <p class="level0"><a name="OBJECTIVES"></a><h2 class="nroffsh">OBJECTIVES</h2>
51 <p class="level0">The share interface was added to enable sharing of data between curl "handles". <a name="ONE"></a><h2 class="nroffsh">ONE SET OF DATA - MANY TRANSFERS</h2>
52 <p class="level0">You can have multiple easy handles share data between them. Have them update and use the <span Class="bold">same</span> cookie database or DNS cache! This way, each single transfer will take advantage from data updates made by the other transfer(s). <a name="SHARE"></a><h2 class="nroffsh">SHARE OBJECT</h2>
53 <p class="level0">You create a shared object with <a class="emphasis" href="./curl_share_init.html">curl_share_init(3)</a>. It returns a handle for a newly created one. 
54 <p class="level0">You tell the shared object what data you want it to share by using <a class="emphasis" href="./curl_share_setopt.html">curl_share_setopt(3)</a>. Currently you can only share DNS and/or COOKIE data. 
55 <p class="level0">Since you can use this share from multiple threads, and libcurl has no internal thread synchronization, you must provide mutex callbacks if you're using this multi-threaded. You set lock and unlock functions with <a class="emphasis" href="./curl_share_setopt.html">curl_share_setopt(3)</a> too. 
56 <p class="level0">Then, you make an easy handle to use this share, you set the <span Class="emphasis">CURLOPT_SHARE</span> option with <a class="emphasis" href="./curl_easy_setopt.html">curl_easy_setopt(3)</a>, and pass in share handle. You can make any number of easy handles share the same share handle. 
57 <p class="level0">To make an easy handle stop using that particular share, you set <span Class="emphasis">CURLOPT_SHARE</span> to NULL for that easy handle. To make a handle stop sharing a particular data, you can <span Class="emphasis">CURLSHOPT_UNSHARE</span> it. 
58 <p class="level0">When you're done using the share, make sure that no easy handle is still using it, and call <a class="emphasis" href="./curl_share_cleanup.html">curl_share_cleanup(3)</a> on the handle. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
59 <p class="level0"><a class="manpage" href="./curl_share_init.html">curl_share_init (3)</a> <a class="manpage" href="./curl_share_setopt.html">  curl_share_setopt (3)</a> <a class="manpage" href="./curl_share_cleanup.html">  curl_share_cleanup (3)</a> <p class="roffit">
60  This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
61 </body></html>