Install curl-7.25.0.tar.bz2
[msysgit.git] / mingw / share / man / man3 / curl_share_setopt.3
blob295423ae323687cfdddf58932acae344c4cefdf6
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .TH curl_share_setopt 3 "8 Aug 2003" "libcurl 7.10.7" "libcurl Manual"
23 .SH NAME
24 curl_share_setopt - Set options for a shared object
25 .SH SYNOPSIS
26 .B #include <curl/curl.h>
27 .sp
28 CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, parameter);
29 .ad
30 .SH DESCRIPTION
31 Set the \fIoption\fP to \fIparameter\fP for the given \fIshare\fP.
32 .SH OPTIONS
33 .IP CURLSHOPT_LOCKFUNC
34 The \fIparameter\fP must be a pointer to a function matching the following
35 prototype:
37 void lock_function(CURL *handle, curl_lock_data data, curl_lock_access access,
38 void *userptr);
40 \fIdata\fP defines what data libcurl wants to lock, and you must make sure that
41 only one lock is given at any time for each kind of data.
43 \fIaccess\fP defines what access type libcurl wants, shared or single.
45 \fIuserptr\fP is the pointer you set with \fICURLSHOPT_USERDATA\fP.
46 .IP CURLSHOPT_UNLOCKFUNC
47 The \fIparameter\fP must be a pointer to a function matching the following
48 prototype:
50 void unlock_function(CURL *handle, curl_lock_data data, void *userptr);
52 \fIdata\fP defines what data libcurl wants to unlock, and you must make sure
53 that only one lock is given at any time for each kind of data.
55 \fIuserptr\fP is the pointer you set with \fICURLSHOPT_USERDATA\fP.
56 .IP CURLSHOPT_SHARE
57 The \fIparameter\fP specifies a type of data that should be shared. This may
58 be set to one of the values described below.
59 .RS
60 .IP CURL_LOCK_DATA_COOKIE
61 Cookie data will be shared across the easy handles using this shared object.
62 .IP CURL_LOCK_DATA_DNS
63 Cached DNS hosts will be shared across the easy handles using this shared
64 object. Note that when you use the multi interface, all easy handles added to
65 the same multi handle will share DNS cache by default without this having to
66 be used!
67 .IP CURL_LOCK_DATA_SSL_SESSION
68 SSL session IDs will be shared accross the easy handles using this shared
69 object. This will reduce the time spent in the SSL handshake when reconnecting
70 to the same server. Note SSL session IDs are reused within the same easy handle
71 by default.
72 .RE
73 .IP CURLSHOPT_UNSHARE
74 This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that
75 the specified \fIparameter\fP will no longer be shared. Valid values are
76 the same as those for \fICURLSHOPT_SHARE\fP.
77 .IP CURLSHOPT_USERDATA
78 The \fIparameter\fP allows you to specify a pointer to data that will be passed
79 to the lock_function and unlock_function each time it is called.
80 .SH RETURN VALUE
81 CURLSHE_OK (zero) means that the option was set properly, non-zero means an
82 error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors.3\fP
83 man page for the full list with descriptions.
84 .SH "SEE ALSO"
85 .BR curl_share_cleanup "(3), " curl_share_init "(3)"