]> rtime.felk.cvut.cz Git - hornmich/skoda-qr-demo.git/blob - QRScanner/mobile/jni/thirdparty/curl/docs/libcurl/curl_multi_setopt.3
Add MuPDF native source codes
[hornmich/skoda-qr-demo.git] / QRScanner / mobile / jni / thirdparty / curl / docs / libcurl / curl_multi_setopt.3
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_multi_setopt 3 "10 Oct 2006" "libcurl 7.16.0" "libcurl Manual"
23 .SH NAME
24 curl_multi_setopt \- set options for a curl multi handle
25 .SH SYNOPSIS
26 #include <curl/curl.h>
27
28 CURLMcode curl_multi_setopt(CURLM * multi_handle, CURLMoption option, param);
29 .SH DESCRIPTION
30 curl_multi_setopt() is used to tell a libcurl multi handle how to behave. By
31 using the appropriate options to \fIcurl_multi_setopt(3)\fP, you can change
32 libcurl's behaviour when using that multi handle.  All options are set with
33 the \fIoption\fP followed by the parameter \fIparam\fP. That parameter can be
34 a \fBlong\fP, a \fBfunction pointer\fP, an \fBobject pointer\fP or a
35 \fBcurl_off_t\fP type, depending on what the specific option expects. Read
36 this manual carefully as bad input values may cause libcurl to behave badly!
37 You can only set one option in each function call.
38
39 .SH OPTIONS
40 .IP CURLMOPT_SOCKETFUNCTION
41 Pass a pointer to a function matching the \fBcurl_socket_callback\fP
42 prototype. The \fIcurl_multi_socket_action(3)\fP function informs the
43 application about updates in the socket (file descriptor) status by doing
44 none, one, or multiple calls to the curl_socket_callback given in the
45 \fBparam\fP argument. They update the status with changes since the previous
46 time a \fIcurl_multi_socket(3)\fP function was called. If the given callback
47 pointer is NULL, no callback will be called. Set the callback's \fBuserp\fP
48 argument with \fICURLMOPT_SOCKETDATA\fP.  See \fIcurl_multi_socket(3)\fP for
49 more callback details.
50 .IP CURLMOPT_SOCKETDATA
51 Pass a pointer to whatever you want passed to the \fBcurl_socket_callback\fP's
52 fourth argument, the userp pointer. This is not used by libcurl but only
53 passed-thru as-is. Set the callback pointer with
54 \fICURLMOPT_SOCKETFUNCTION\fP.
55 .IP CURLMOPT_PIPELINING
56 Pass a long set to 1 to enable or 0 to disable. Enabling pipelining on a multi
57 handle will make it attempt to perform HTTP Pipelining as far as possible for
58 transfers using this handle. This means that if you add a second request that
59 can use an already existing connection, the second request will be \&"piped"
60 on the same connection rather than being executed in parallel. (Added in
61 7.16.0)
62 .IP CURLMOPT_TIMERFUNCTION
63 Pass a pointer to a function matching the \fBcurl_multi_timer_callback\fP
64 prototype: int curl_multi_timer_callback(CURLM *multi /* multi handle */,
65 long timeout_ms /* timeout in milliseconds */, void *userp /* TIMERDATA */).
66 This function will then be called when the timeout value
67 changes. The timeout value is at what latest time the application should call
68 one of the \&"performing" functions of the multi interface
69 (\fIcurl_multi_socket_action(3)\fP and \fIcurl_multi_perform(3)\fP) - to allow
70 libcurl to keep timeouts and retries etc to work. A timeout value of -1 means
71 that there is no timeout at all, and 0 means that the timeout is already
72 reached. Libcurl attempts to limit calling this only when the fixed future
73 timeout time actually changes. See also \fICURLMOPT_TIMERDATA\fP. The callback
74 should return 0 on success, and -1 on error. This
75 callback can be used instead of, or in addition to,
76 \fIcurl_multi_timeout(3)\fP. (Added in 7.16.0)
77 .IP CURLMOPT_TIMERDATA
78 Pass a pointer to whatever you want passed to the
79 \fBcurl_multi_timer_callback\fP's third argument, the userp pointer.  This is
80 not used by libcurl but only passed-thru as-is. Set the callback pointer with
81 \fICURLMOPT_TIMERFUNCTION\fP. (Added in 7.16.0)
82 .IP CURLMOPT_MAXCONNECTS
83 Pass a long. The set number will be used as the maximum amount of
84 simultaneously open connections that libcurl may cache. Default is 10, and
85 libcurl will enlarge the size for each added easy handle to make it fit 4
86 times the number of added easy handles.
87
88 By setting this option, you can prevent the cache size from growing beyond the
89 limit set by you.
90
91 When the cache is full, curl closes the oldest one in the cache to prevent the
92 number of open connections from increasing.
93
94 This option is for the multi handle's use only, when using the easy interface
95 you should instead use the \fICURLOPT_MAXCONNECTS\fP option.
96
97 (Added in 7.16.3)
98 .IP CURLMOPT_MAX_HOST_CONNECTIONS
99 Pass a long. The set number will be used as the maximum amount of
100 simultaneously open connections to a single host. For each new session to
101 a host, libcurl will open a new connection up to the limit set by
102 CURLMOPT_MAX_HOST_CONNECTIONS. When the limit is reached, the sessions will
103 be pending until there are available connections. If CURLMOPT_PIPELINING is
104 1, libcurl will try to pipeline if the host is capable of it.
105
106 The default value is 0, which means that there is no limit.
107 However, for backwards compatibility, setting it to 0 when CURLMOPT_PIPELINING
108 is 1 will not be treated as unlimited. Instead it will open only 1 connection
109 and try to pipeline on it.
110
111 (Added in 7.30.0)
112 .IP CURLMOPT_MAX_PIPELINE_LENGTH
113 Pass a long. The set number will be used as the maximum amount of requests
114 in a pipelined connection. When this limit is reached, libcurl will use another
115 connection to the same host (see CURLMOPT_MAX_HOST_CONNECTIONS), or queue the
116 requests until one of the pipelines to the host is ready to accept a request.
117 Thus, the total number of requests in-flight is CURLMOPT_MAX_HOST_CONNECTIONS *
118 CURLMOPT_MAX_PIPELINE_LENGTH.
119 The default value is 5.
120
121 (Added in 7.30.0)
122 .IP CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
123 Pass a long. If a pipelined connection is currently processing a request
124 with a Content-Length larger than CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, that
125 connection will not be considered for additional requests, even if it is
126 shorter than CURLMOPT_MAX_PIPELINE_LENGTH.
127 The default value is 0, which means that the penalization is inactive.
128
129 (Added in 7.30.0)
130 .IP CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
131 Pass a long. If a pipelined connection is currently processing a
132 chunked (Transfer-encoding: chunked) request with a current chunk length
133 larger than CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, that connection will not be
134 considered for additional requests, even if it is shorter than
135 CURLMOPT_MAX_PIPELINE_LENGTH.
136 The default value is 0, which means that the penalization is inactive.
137
138 (Added in 7.30.0)
139 .IP CURLMOPT_PIPELINING_SITE_BL
140 Pass an array of char *, ending with NULL. This is a list of sites that are
141 blacklisted from pipelining, i.e sites that are known to not support HTTP
142 pipelining. The array is copied by libcurl.
143
144 The default value is NULL, which means that there is no blacklist.
145
146 Pass a NULL pointer to clear the blacklist.
147
148 Example:
149
150 .nf
151   site_blacklist[] =
152   {
153     "www.haxx.se",
154     "www.example.com:1234",
155     NULL
156   };
157
158   curl_multi_setopt(m, CURLMOPT_PIPELINE_SITE_BL, site_blacklist);
159 .fi
160
161 (Added in 7.30.0)
162 .IP CURLMOPT_PIPELINING_SERVER_BL
163 Pass an array of char *, ending with NULL. This is a list of server types
164 prefixes (in the Server: HTTP header) that are blacklisted from pipelining,
165 i.e server types that are known to not support HTTP pipelining. The array is
166 copied by libcurl.
167
168 Note that the comparison matches if the Server: header begins with the string
169 in the blacklist, i.e "Server: Ninja 1.2.3" and "Server: Ninja 1.4.0" can 
170 both be blacklisted by having "Ninja" in the backlist.
171
172 The default value is NULL, which means that there is no blacklist.
173
174 Pass a NULL pointer to clear the blacklist.
175
176 Example:
177
178 .nf
179   server_blacklist[] =
180   {
181     "Microsoft-IIS/6.0",
182     "nginx/0.8.54",
183     NULL
184   };
185
186   curl_multi_setopt(m, CURLMOPT_PIPELINE_SERVER_BL, server_blacklist);
187 .fi
188
189 (Added in 7.30.0)
190 .IP CURLMOPT_MAX_TOTAL_CONNECTIONS
191 Pass a long. The set number will be used as the maximum amount of
192 simultaneously open connections in total. For each new session, libcurl
193 will open a new connection up to the limit set by
194 CURLMOPT_MAX_TOTAL_CONNECTIONS. When the limit is reached, the sessions will
195 be pending until there are available connections. If CURLMOPT_PIPELINING is
196 1, libcurl will try to pipeline if the host is capable of it.
197
198 The default value is 0, which means that there is no limit.
199 However, for backwards compatibility, setting it to 0 when CURLMOPT_PIPELINING
200 is 1 will not be treated as unlimited. Instead it will open only 1 connection
201 and try to pipeline on it.
202
203 (Added in 7.30.0)
204 .SH RETURNS
205 The standard CURLMcode for multi interface error codes. Note that it returns a
206 CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl
207 doesn't know of.
208 .SH AVAILABILITY
209 This function was added in libcurl 7.15.4.
210 .SH "SEE ALSO"
211 .BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
212 .BR curl_multi_socket "(3), " curl_multi_info_read "(3)"