Git init
[external/curl.git] / docs / libcurl / curl_easy_setopt.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2010, 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 .\"
23 .TH curl_easy_setopt 3 "1 Jan 2010" "libcurl 7.20.0" "libcurl Manual"
24 .SH NAME
25 curl_easy_setopt \- set options for a curl easy handle
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
30 .SH DESCRIPTION
31 curl_easy_setopt() is used to tell libcurl how to behave. By using the
32 appropriate options to \fIcurl_easy_setopt\fP, you can change libcurl's
33 behavior.  All options are set with the \fIoption\fP followed by a
34 \fIparameter\fP. That parameter can be a \fBlong\fP, a \fBfunction pointer\fP,
35 an \fBobject pointer\fP or a \fBcurl_off_t\fP, depending on what the specific
36 option expects. Read this manual carefully as bad input values may cause
37 libcurl to behave badly!  You can only set one option in each function call. A
38 typical application uses many curl_easy_setopt() calls in the setup phase.
39
40 Options set with this function call are valid for all forthcoming transfers
41 performed using this \fIhandle\fP.  The options are not in any way reset
42 between transfers, so if you want subsequent transfers with different options,
43 you must change them between the transfers. You can optionally reset all
44 options back to internal default with \fIcurl_easy_reset(3)\fP.
45
46 Strings passed to libcurl as 'char *' arguments, are copied by the library;
47 thus the string storage associated to the pointer argument may be overwritten
48 after curl_easy_setopt() returns. Exceptions to this rule are described in
49 the option details below.
50
51 Before version 7.17.0, strings were not copied. Instead the user was forced
52 keep them available until libcurl no longer needed them.
53
54 The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
55 \fIcurl_easy_duphandle(3)\fP call.
56 .SH BEHAVIOR OPTIONS
57 .IP CURLOPT_VERBOSE
58 Set the parameter to 1 to get the library to display a lot of verbose
59 information about its operations. Very useful for libcurl and/or protocol
60 debugging and understanding. The verbose information will be sent to stderr,
61 or the stream set with \fICURLOPT_STDERR\fP.
62
63 You hardly ever want this set in production use, you will almost always want
64 this when you debug/report problems. Another neat option for debugging is the
65 \fICURLOPT_DEBUGFUNCTION\fP.
66 .IP CURLOPT_HEADER
67 A parameter set to 1 tells the library to include the header in the body
68 output. This is only relevant for protocols that actually have headers
69 preceding the data (like HTTP).
70 .IP CURLOPT_NOPROGRESS
71 A parameter set to 1 tells the library to shut off the built-in progress meter
72 completely.
73
74 Future versions of libcurl are likely to not have any built-in progress meter
75 at all.
76 .IP CURLOPT_NOSIGNAL
77 Pass a long. If it is 1, libcurl will not use any functions that
78 install signal handlers or any functions that cause signals to be sent to the
79 process. This option is mainly here to allow multi-threaded unix applications
80 to still set/use all timeout options etc, without risking getting signals.
81 (Added in 7.10)
82
83 If this option is set and libcurl has been built with the standard name
84 resolver, timeouts will not occur while the name resolve takes place.
85 Consider building libcurl with c-ares support to enable asynchronous DNS
86 lookups, which enables nice timeouts for name resolves without signals.
87
88 Setting \fICURLOPT_NOSIGNAL\fP to 1 makes libcurl NOT ask the system to ignore
89 SIGPIPE signals, which otherwise are sent by the system when trying to send
90 data to a socket which is closed in the other end. libcurl makes an effort to
91 never cause such SIGPIPEs to trigger, but some operating systems have no way
92 to avoid them and even on those that have there are some corner cases when
93 they may still happen, contrary to our desire.
94 .IP CURLOPT_WILDCARDMATCH
95 Set this option to 1 if you want to transfer multiple files according to a
96 file name pattern. The pattern can be specified as part of the
97 \fICURLOPT_URL\fP option, using an fnmatch-like pattern (Shell Pattern
98 Matching) in the last part of URL (file name).
99
100 By default, libcurl uses its internal wildcard matching implementation. You
101 can provide your own matching function by the \fICURLOPT_FNMATCH_FUNCTION\fP
102 option.
103
104 This feature is only supported by the FTP download for now.
105
106 A brief introduction of its syntax follows:
107 .RS
108 .IP "\fB*\fP - ASTERISK"
109 \&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root
110 directory)
111 .RE
112 .RS
113 .IP "\fB?\fP - QUESTION MARK"
114 Question mark matches any (exactly one) character.
115
116 \&ftp://example.com/some/path/\fBphoto?.jpeg\fP
117 .RE
118 .RS
119 .IP "\fB[\fP - BRACKET EXPRESSION"
120 The left bracket opens a bracket expression. The question mark and asterisk have
121 no special meaning in a bracket expression. Each bracket expression ends by the
122 right bracket and matches exactly one character. Some examples follow:
123
124 \fB[a-zA-Z0\-9]\fP or \fB[f\-gF\-G]\fP \- character interval
125
126 \fB[abc]\fP - character enumeration
127
128 \fB[^abc]\fP or \fB[!abc]\fP - negation
129
130 \fB[[:\fP\fIname\fP\fB:]]\fP class expression. Supported classes are
131 \fBalnum\fP,\fBlower\fP, \fBspace\fP, \fBalpha\fP, \fBdigit\fP, \fBprint\fP,
132 \fBupper\fP, \fBblank\fP, \fBgraph\fP, \fBxdigit\fP.
133
134 \fB[][-!^]\fP - special case \- matches only '\-', ']', '[', '!' or '^'. These
135 characters have no special purpose.
136
137 \fB[\\[\\]\\\\]\fP - escape syntax. Matches '[', ']' or '\\'.
138
139 Using the rules above, a file name pattern can be constructed:
140
141 \&ftp://example.com/some/path/\fB[a-z[:upper:]\\\\].jpeg\fP
142 .RE
143 .PP
144 (This was added in 7.21.0)
145 .SH CALLBACK OPTIONS
146 .IP CURLOPT_WRITEFUNCTION
147 Function pointer that should match the following prototype: \fBsize_t
148 function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
149 function gets called by libcurl as soon as there is data received that needs
150 to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
151 multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
152 of bytes actually taken care of. If that amount differs from the amount passed
153 to your function, it'll signal an error to the library. This will abort the
154 transfer and return \fICURLE_WRITE_ERROR\fP.
155
156 From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will
157 cause writing to this connection to become paused. See
158 \fIcurl_easy_pause(3)\fP for further details.
159
160 This function may be called with zero bytes data if the transferred file is
161 empty.
162
163 Set this option to NULL to get the internal default function. The internal
164 default function will write the data to the FILE * given with
165 \fICURLOPT_WRITEDATA\fP.
166
167 Set the \fIuserdata\fP argument with the \fICURLOPT_WRITEDATA\fP option.
168
169 The callback function will be passed as much data as possible in all invokes,
170 but you cannot possibly make any assumptions. It may be one byte, it may be
171 thousands. The maximum amount of data that can be passed to the write callback
172 is defined in the curl.h header file: CURL_MAX_WRITE_SIZE.
173 .IP CURLOPT_WRITEDATA
174 Data pointer to pass to the file write function. If you use the
175 \fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as
176 input. If you don't use a callback, you must pass a 'FILE *' as libcurl will
177 pass this to fwrite() when writing data.
178
179 The internal \fICURLOPT_WRITEFUNCTION\fP will write the data to the FILE *
180 given with this option, or to stdout if this option hasn't been set.
181
182 If you're using libcurl as a win32 DLL, you \fBMUST\fP use the
183 \fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience
184 crashes.
185
186 This option is also known with the older name \fICURLOPT_FILE\fP, the name
187 \fICURLOPT_WRITEDATA\fP was introduced in 7.9.7.
188 .IP CURLOPT_READFUNCTION
189 Function pointer that should match the following prototype: \fBsize_t
190 function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
191 function gets called by libcurl as soon as it needs to read data in order to
192 send it to the peer. The data area pointed at by the pointer \fIptr\fP may be
193 filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
194 bytes. Your function must return the actual number of bytes that you stored in
195 that memory area. Returning 0 will signal end-of-file to the library and cause
196 it to stop the current transfer.
197
198 If you stop the current transfer by returning 0 "pre-maturely" (i.e before the
199 server expected it, like when you've said you will upload N bytes and you
200 upload less than N bytes), you may experience that the server "hangs" waiting
201 for the rest of the data that won't come.
202
203 The read callback may return \fICURL_READFUNC_ABORT\fP to stop the current
204 operation immediately, resulting in a \fICURLE_ABORTED_BY_CALLBACK\fP error
205 code from the transfer (Added in 7.12.1)
206
207 From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause
208 reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP
209 for further details.
210
211 If you set this callback pointer to NULL, or don't set it at all, the default
212 internal read function will be used. It is doing an fread() on the FILE *
213 userdata set with \fICURLOPT_READDATA\fP.
214 .IP CURLOPT_READDATA
215 Data pointer to pass to the file read function. If you use the
216 \fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If
217 you don't specify a read callback but instead rely on the default internal
218 read function, this data must be a valid readable FILE *.
219
220 If you're using libcurl as a win32 DLL, you MUST use a
221 \fICURLOPT_READFUNCTION\fP if you set this option.
222
223 This option was also known by the older name \fICURLOPT_INFILE\fP, the name
224 \fICURLOPT_READDATA\fP was introduced in 7.9.7.
225 .IP CURLOPT_IOCTLFUNCTION
226 Function pointer that should match the \fIcurl_ioctl_callback\fP prototype
227 found in \fI<curl/curl.h>\fP. This function gets called by libcurl when
228 something special I/O-related needs to be done that the library can't do by
229 itself. For now, rewinding the read data stream is the only action it can
230 request. The rewinding of the read data stream may be necessary when doing a
231 HTTP PUT or POST with a multi-pass authentication method.  (Option added in
232 7.12.3).
233
234 Use \fICURLOPT_SEEKFUNCTION\fP instead to provide seeking!
235 .IP CURLOPT_IOCTLDATA
236 Pass a pointer that will be untouched by libcurl and passed as the 3rd
237 argument in the ioctl callback set with \fICURLOPT_IOCTLFUNCTION\fP.  (Option
238 added in 7.12.3)
239 .IP CURLOPT_SEEKFUNCTION
240 Function pointer that should match the following prototype: \fIint
241 function(void *instream, curl_off_t offset, int origin);\fP This function gets
242 called by libcurl to seek to a certain position in the input stream and can be
243 used to fast forward a file in a resumed upload (instead of reading all
244 uploaded bytes with the normal read function/callback). It is also called to
245 rewind a stream when doing a HTTP PUT or POST with a multi-pass authentication
246 method. The function shall work like "fseek" or "lseek" and accepted SEEK_SET,
247 SEEK_CUR and SEEK_END as argument for origin, although (in 7.18.0) libcurl
248 only passes SEEK_SET. The callback must return 0 (CURL_SEEKFUNC_OK) on
249 success, 1 (CURL_SEEKFUNC_FAIL) to cause the upload operation to fail or 2
250 (CURL_SEEKFUNC_CANTSEEK) to indicate that while the seek failed, libcurl is
251 free to work around the problem if possible. The latter can sometimes be done
252 by instead reading from the input or similar.
253
254 If you forward the input arguments directly to "fseek" or "lseek", note that
255 the data type for \fIoffset\fP is not the same as defined for curl_off_t on
256 many systems! (Option added in 7.18.0)
257 .IP CURLOPT_SEEKDATA
258 Data pointer to pass to the file read function. If you use the
259 \fICURLOPT_SEEKFUNCTION\fP option, this is the pointer you'll get as input. If
260 you don't specify a seek callback, NULL is passed. (Option added in 7.18.0)
261 .IP CURLOPT_SOCKOPTFUNCTION
262 Function pointer that should match the \fIcurl_sockopt_callback\fP prototype
263 found in \fI<curl/curl.h>\fP. This function gets called by libcurl after the
264 socket() call but before the connect() call. The callback's \fIpurpose\fP
265 argument identifies the exact purpose for this particular socket, and
266 currently only one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the
267 primary connection (meaning the control connection in the FTP case). Future
268 versions of libcurl may support more purposes. It passes the newly created
269 socket descriptor so additional setsockopt() calls can be done at the user's
270 discretion.  Return 0 (zero) from the callback on success. Return 1 from the
271 callback function to signal an unrecoverable error to the library and it will
272 close the socket and return \fICURLE_COULDNT_CONNECT\fP.  (Option added in
273 7.15.6.)
274 .IP CURLOPT_SOCKOPTDATA
275 Pass a pointer that will be untouched by libcurl and passed as the first
276 argument in the sockopt callback set with \fICURLOPT_SOCKOPTFUNCTION\fP.
277 (Option added in 7.15.6.)
278 .IP CURLOPT_OPENSOCKETFUNCTION
279 Function pointer that should match the \fIcurl_opensocket_callback\fP
280 prototype found in \fI<curl/curl.h>\fP. This function gets called by libcurl
281 instead of the \fIsocket(2)\fP call. The callback's \fIpurpose\fP argument
282 identifies the exact purpose for this particular socket, and currently only
283 one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the primary connection
284 (meaning the control connection in the FTP case). Future versions of libcurl
285 may support more purposes. It passes the resolved peer address as a
286 \fIaddress\fP argument so the callback can modify the address or refuse to
287 connect at all. The callback function should return the socket or
288 \fICURL_SOCKET_BAD\fP in case no connection should be established or any error
289 detected. Any additional \fIsetsockopt(2)\fP calls can be done on the socket
290 at the user's discretion.  \fICURL_SOCKET_BAD\fP return value from the
291 callback function will signal an unrecoverable error to the library and it
292 will return \fICURLE_COULDNT_CONNECT\fP.  This return code can be used for IP
293 address blacklisting.  The default behavior is:
294 .nf
295    return socket(addr->family, addr->socktype, addr->protocol);
296 .fi
297 (Option added in 7.17.1.)
298 .IP CURLOPT_OPENSOCKETDATA
299 Pass a pointer that will be untouched by libcurl and passed as the first
300 argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP.
301 (Option added in 7.17.1.)
302 .IP CURLOPT_PROGRESSFUNCTION
303 Function pointer that should match the \fIcurl_progress_callback\fP prototype
304 found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
305 its internal equivalent with a frequent interval during operation (roughly
306 once per second or sooner) no matter if data is being transfered or not.
307 Unknown/unused argument values passed to the callback will be set to zero
308 (like if you only download data, the upload size will remain 0). Returning a
309 non-zero value from this callback will cause libcurl to abort the transfer and
310 return \fICURLE_ABORTED_BY_CALLBACK\fP.
311
312 If you transfer data with the multi interface, this function will not be
313 called during periods of idleness unless you call the appropriate libcurl
314 function that performs transfers.
315
316 \fICURLOPT_NOPROGRESS\fP must be set to 0 to make this function actually
317 get called.
318 .IP CURLOPT_PROGRESSDATA
319 Pass a pointer that will be untouched by libcurl and passed as the first
320 argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
321 .IP CURLOPT_HEADERFUNCTION
322 Function pointer that should match the following prototype: \fIsize_t
323 function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP. This
324 function gets called by libcurl as soon as it has received header data. The
325 header callback will be called once for each header and only complete header
326 lines are passed on to the callback. Parsing headers should be easy enough
327 using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP
328 multiplied with \fInmemb\fP. Do not assume that the header line is zero
329 terminated! The pointer named \fIuserdata\fP is the one you set with the
330 \fICURLOPT_WRITEHEADER\fP option. The callback function must return the number
331 of bytes actually taken care of. If that amount differs from the amount passed
332 to your function, it'll signal an error to the library. This will abort the
333 transfer and return \fICURL_WRITE_ERROR\fP.
334
335 If this option is not set, or if it is set to NULL, but
336 \fICURLOPT_HEADERDATA\fP (\fICURLOPT_WRITEHEADER\fP) is set to anything but
337 NULL, the function used to accept response data will be used instead. That is,
338 it will be the function specified with \fICURLOPT_WRITEFUNCTION\fP, or if it
339 is not specified or NULL - the default, stream-writing function.
340
341 It's important to note that the callback will be invoked for the headers of
342 all responses received after initiating a request and not just the final
343 response. This includes all responses which occur during authentication
344 negotiation. If you need to operate on only the headers from the final
345 response, you will need to collect headers in the callback yourself and use
346 HTTP status lines, for example, to delimit response boundaries.
347
348 Since 7.14.1: When a server sends a chunked encoded transfer, it may contain a
349 trailer. That trailer is identical to a HTTP header and if such a trailer is
350 received it is passed to the application using this callback as well. There
351 are several ways to detect it being a trailer and not an ordinary header: 1)
352 it comes after the response-body. 2) it comes after the final header line (CR
353 LF) 3) a Trailer: header among the response-headers mention what header to
354 expect in the trailer.
355 .IP CURLOPT_WRITEHEADER
356 (This option is also known as \fBCURLOPT_HEADERDATA\fP) Pass a pointer to be
357 used to write the header part of the received data to. If you don't use your
358 own callback to take care of the writing, this must be a valid FILE *. See
359 also the \fICURLOPT_HEADERFUNCTION\fP option above on how to set a custom
360 get-all-headers callback.
361 .IP CURLOPT_DEBUGFUNCTION
362 Function pointer that should match the following prototype: \fIint
363 curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP
364 \fICURLOPT_DEBUGFUNCTION\fP replaces the standard debug function used when
365 \fICURLOPT_VERBOSE \fP is in effect. This callback receives debug information,
366 as specified with the \fBcurl_infotype\fP argument. This function must return
367 0.  The data pointed to by the char * passed to this function WILL NOT be zero
368 terminated, but will be exactly of the size as told by the size_t argument.
369
370 Available curl_infotype values:
371 .RS
372 .IP CURLINFO_TEXT
373 The data is informational text.
374 .IP CURLINFO_HEADER_IN
375 The data is header (or header-like) data received from the peer.
376 .IP CURLINFO_HEADER_OUT
377 The data is header (or header-like) data sent to the peer.
378 .IP CURLINFO_DATA_IN
379 The data is protocol data received from the peer.
380 .IP CURLINFO_DATA_OUT
381 The data is protocol data sent to the peer.
382 .RE
383 .IP CURLOPT_DEBUGDATA
384 Pass a pointer to whatever you want passed in to your
385 \fICURLOPT_DEBUGFUNCTION\fP in the last void * argument. This pointer is not
386 used by libcurl, it is only passed to the callback.
387 .IP CURLOPT_SSL_CTX_FUNCTION
388 This option does only function for libcurl powered by OpenSSL. If libcurl was
389 built against another SSL library, this functionality is absent.
390
391 Function pointer that should match the following prototype: \fBCURLcode
392 sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called
393 by libcurl just before the initialization of an SSL connection after having
394 processed all other SSL related options to give a last chance to an
395 application to modify the behaviour of openssl's ssl initialization. The
396 \fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If
397 an error is returned no attempt to establish a connection is made and the
398 perform operation will return the error code from this callback function.  Set
399 the \fIparm\fP argument with the \fICURLOPT_SSL_CTX_DATA\fP option. This
400 option was introduced in 7.11.0.
401
402 This function will get called on all new connections made to a server, during
403 the SSL negotiation. The SSL_CTX pointer will be a new one every time.
404
405 To use this properly, a non-trivial amount of knowledge of the openssl
406 libraries is necessary. For example, using this function allows you to use
407 openssl callbacks to add additional validation code for certificates, and even
408 to change the actual URI of an HTTPS request (example used in the lib509 test
409 case).  See also the example section for a replacement of the key, certificate
410 and trust file settings.
411 .IP CURLOPT_SSL_CTX_DATA
412 Data pointer to pass to the ssl context callback set by the option
413 \fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third
414 parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
415 .IP CURLOPT_CONV_TO_NETWORK_FUNCTION
416 .IP CURLOPT_CONV_FROM_NETWORK_FUNCTION
417 .IP CURLOPT_CONV_FROM_UTF8_FUNCTION
418 Function pointers that should match the following prototype: CURLcode
419 function(char *ptr, size_t length);
420
421 These three options apply to non-ASCII platforms only.  They are available
422 only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built. When
423 this is the case, \fIcurl_version_info(3)\fP will return the CURL_VERSION_CONV
424 feature bit set.
425
426 The data to be converted is in a buffer pointed to by the ptr parameter.  The
427 amount of data to convert is indicated by the length parameter.  The converted
428 data overlays the input data in the buffer pointed to by the ptr parameter.
429 CURLE_OK should be returned upon successful conversion.  A CURLcode return
430 value defined by curl.h, such as CURLE_CONV_FAILED, should be returned if an
431 error was encountered.
432
433 \fBCURLOPT_CONV_TO_NETWORK_FUNCTION\fP and
434 \fBCURLOPT_CONV_FROM_NETWORK_FUNCTION\fP convert between the host encoding and
435 the network encoding.  They are used when commands or ASCII data are
436 sent/received over the network.
437
438 \fBCURLOPT_CONV_FROM_UTF8_FUNCTION\fP is called to convert from UTF8 into the
439 host encoding.  It is required only for SSL processing.
440
441 If you set a callback pointer to NULL, or don't set it at all, the built-in
442 libcurl iconv functions will be used.  If HAVE_ICONV was not defined when
443 libcurl was built, and no callback has been established, conversion will
444 return the CURLE_CONV_REQD error code.
445
446 If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined.
447 For example:
448
449  \&#define CURL_ICONV_CODESET_OF_HOST "IBM-1047"
450
451 The iconv code in libcurl will default the network and UTF8 codeset names as
452 follows:
453
454  \&#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"
455
456  \&#define CURL_ICONV_CODESET_FOR_UTF8   "UTF-8"
457
458 You will need to override these definitions if they are different on your
459 system.
460 .IP CURLOPT_INTERLEAVEFUNCTION
461 Function pointer that should match the following prototype: \fIsize_t
462 function( void *ptr, size_t size, size_t nmemb, void *userdata)\fP. This
463 function gets called by libcurl as soon as it has received interleaved RTP
464 data. This function gets called for each $ block and therefore contains
465 exactly one upper-layer protocol unit (e.g.  one RTP packet). Curl writes the
466 interleaved header as well as the included data for each call. The first byte
467 is always an ASCII dollar sign. The dollar sign is followed by a one byte
468 channel identifier and then a 2 byte integer length in network byte order. See
469 \fIRFC 2326 Section 10.12\fP for more information on how RTP interleaving
470 behaves. If unset or set to NULL, curl will use the default write function.
471
472 Interleaved RTP poses some challeneges for the client application. Since the
473 stream data is sharing the RTSP control connection, it is critical to service
474 the RTP in a timely fashion. If the RTP data is not handled quickly,
475 subsequent response processing may become unreasonably delayed and the
476 connection may close. The application may use \fICURL_RTSPREQ_RECEIVE\fP to
477 service RTP data when no requests are desired. If the application makes a
478 request, (e.g.  \fICURL_RTSPREQ_PAUSE\fP) then the response handler will
479 process any pending RTP data before marking the request as finished.  (Added
480 in 7.20.0)
481 .IP CURLOPT_INTERLEAVEDATA
482 This is the userdata pointer that will be passed to
483 \fICURLOPT_INTERLEAVEFUNCTION\fP when interleaved RTP data is received. (Added
484 in 7.20.0)
485 .IP CURLOPT_CHUNK_BGN_FUNCTION
486 Function pointer that should match the following prototype: \fBlong function
487 (const void *transfer_info, void *ptr, int remains)\fP. This function gets
488 called by libcurl before a part of the stream is going to be transferred (if
489 the transfer supports chunks).
490
491 This callback makes sense only when using the \fICURLOPT_WILDCARDMATCH\fP
492 option for now.
493
494 The target of transfer_info parameter is a "feature depended" structure. For
495 the FTP wildcard download, the target is curl_fileinfo structure (see
496 \fIcurl/curl.h\fP).  The parameter ptr is a pointer given by
497 \fICURLOPT_CHUNK_DATA\fP. The parameter remains contains number of chunks
498 remaining per the transfer. If the feature is not available, the parameter has
499 zero value.
500
501 Return \fICURL_CHUNK_BGN_FUNC_OK\fP if everything is fine,
502 \fICURL_CHUNK_BGN_FUNC_SKIP\fP if you want to skip the concrete chunk or
503 \fICURL_CHUNK_BGN_FUNC_FAIL\fP to tell libcurl to stop if some error occurred.
504 (This was added in 7.21.0)
505 .IP CURLOPT_CHUNK_END_FUNCTION
506 Function pointer that should match the following prototype: \fBlong
507 function(void *ptr)\fP. This function gets called by libcurl as soon as a part
508 of the stream has been transferred (or skipped).
509
510 Return \fICURL_CHUNK_END_FUNC_OK\fP if everything is fine or
511 \fBCURL_CHUNK_END_FUNC_FAIL\fP to tell the lib to stop if some error occurred.
512 (This was added in 7.21.0)
513 .IP CURLOPT_CHUNK_DATA
514 Pass a pointer that will be untouched by libcurl and passed as the ptr
515 argument to the \fICURL_CHUNK_BGN_FUNTION\fP and \fICURL_CHUNK_END_FUNTION\fP.
516 (This was added in 7.21.0)
517 .IP CURLOPT_FNMATCH_FUNCTION
518 Function pointer that should match \fBint function(void *ptr, const char
519 *pattern, const char *string)\fP prototype (see \fIcurl/curl.h\fP). It is used
520 internally for the wildcard matching feature.
521
522 Return \fICURL_FNMATCHFUNC_MATCH\fP if pattern matches the string,
523 \fICURL_FNMATCHFUNC_NOMATCH\fP if not or \fICURL_FNMATCHFUNC_FAIL\fP if an
524 error occurred.  (This was added in 7.21.0)
525 .IP CURLOPT_FNMATCH_DATA
526 Pass a pointer that will be untouched by libcurl and passed as the ptr argument
527 to the \fICURL_FNMATCH_FUNCTION\fP. (This was added in 7.21.0)
528 .SH ERROR OPTIONS
529 .IP CURLOPT_ERRORBUFFER
530 Pass a char * to a buffer that the libcurl may store human readable error
531 messages in. This may be more helpful than just the return code from
532 \fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big.
533 Although this argument is a 'char *', it does not describe an input string.
534 Therefore the (probably undefined) contents of the buffer is NOT copied
535 by the library. You should keep the associated storage available until
536 libcurl no longer needs it. Failing to do so will cause very odd behavior
537 or even crashes. libcurl will need it until you call \fIcurl_easy_cleanup(3)\fP
538 or you set the same option again to use a different pointer.
539
540 Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
541 debug/trace why errors happen.
542
543 If the library does not return an error, the buffer may not have been
544 touched. Do not rely on the contents in those cases.
545
546 .IP CURLOPT_STDERR
547 Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr
548 when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data.
549 .IP CURLOPT_FAILONERROR
550 A parameter set to 1 tells the library to fail silently if the HTTP code
551 returned is equal to or larger than 400. The default action would be to return
552 the page normally, ignoring that code.
553
554 This method is not fail-safe and there are occasions where non-successful
555 response codes will slip through, especially when authentication is involved
556 (response codes 401 and 407).
557
558 You might get some amounts of headers transferred before this situation is
559 detected, like when a "100-continue" is received as a response to a
560 POST/PUT and a 401 or 407 is received immediately afterwards.
561 .SH NETWORK OPTIONS
562 .IP CURLOPT_URL
563 The actual URL to deal with. The parameter should be a char * to a zero
564 terminated string.
565
566 If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will
567 attempt to guess which protocol to use based on the given host name. If the
568 given protocol of the set URL is not supported, libcurl will return on error
569 (\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
570 \fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
571 on which protocols are supported.
572
573 The string given to CURLOPT_URL must be url-encoded and follow RFC 2396
574 (http://curl.haxx.se/rfc/rfc2396.txt).
575
576 Starting with version 7.20.0, the fragment part of the URI will not be send as
577 part of the path, which was the case previously.
578
579 \fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
580 \fIcurl_easy_perform(3)\fP is called.
581
582 \fICURLOPT_PROTOCOLS\fP can be used to limit what protocols libcurl will use
583 for this transfer, independent of what libcurl has been compiled to
584 support. That may be useful if you accept the URL from an external source and
585 want to limit the accessibility.
586 .IP CURLOPT_PROTOCOLS
587 Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
588 limits what protocols libcurl may use in the transfer. This allows you to have
589 a libcurl built to support a wide range of protocols but still limit specific
590 transfers to only be allowed to use a subset of them. By default libcurl will
591 accept all protocols it supports. See also
592 \fICURLOPT_REDIR_PROTOCOLS\fP. (Added in 7.19.4)
593 .IP CURLOPT_REDIR_PROTOCOLS
594 Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
595 limits what protocols libcurl may use in a transfer that it follows to in a
596 redirect when \fICURLOPT_FOLLOWLOCATION\fP is enabled. This allows you to
597 limit specific transfers to only be allowed to use a subset of protocols in
598 redirections. By default libcurl will allow all protocols except for FILE and
599 SCP. This is a difference compared to pre-7.19.4 versions which
600 unconditionally would follow to all protocols supported. (Added in 7.19.4)
601 .IP CURLOPT_PROXY
602 Set HTTP proxy to use. The parameter should be a char * to a zero terminated
603 string holding the host name or dotted IP address. To specify port number in
604 this string, append :[port] to the end of the host name. The proxy string may
605 be prefixed with [protocol]:// since any such prefix will be ignored. The
606 proxy's port number may optionally be specified with the separate option. If
607 not specified, libcurl will default to using port 1080 for proxies.
608 \fICURLOPT_PROXYPORT\fP.
609
610 When you tell the library to use an HTTP proxy, libcurl will transparently
611 convert operations to HTTP even if you specify an FTP URL etc. This may have
612 an impact on what other features of the library you can use, such as
613 \fICURLOPT_QUOTE\fP and similar FTP specifics that don't work unless you
614 tunnel through the HTTP proxy. Such tunneling is activated with
615 \fICURLOPT_HTTPPROXYTUNNEL\fP.
616
617 libcurl respects the environment variables \fBhttp_proxy\fP, \fBftp_proxy\fP,
618 \fBall_proxy\fP etc, if any of those are set. The \fICURLOPT_PROXY\fP option
619 does however override any possibly set environment variables.
620
621 Setting the proxy string to "" (an empty string) will explicitly disable the
622 use of a proxy, even if there is an environment variable set for it.
623
624 Since 7.14.1, the proxy host string given in environment variables can be
625 specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP,
626 include protocol prefix (http://) and embedded user + password.
627 .IP CURLOPT_PROXYPORT
628 Pass a long with this option to set the proxy port to connect to unless it is
629 specified in the proxy string \fICURLOPT_PROXY\fP.
630 .IP CURLOPT_PROXYTYPE
631 Pass a long with this option to set type of the proxy. Available options for
632 this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_HTTP_1_0\fP (added in 7.19.4),
633 \fICURLPROXY_SOCKS4\fP (added in 7.15.2), \fICURLPROXY_SOCKS5\fP,
634 \fICURLPROXY_SOCKS4A\fP (added in 7.18.0) and \fICURLPROXY_SOCKS5_HOSTNAME\fP
635 (added in 7.18.0). The HTTP type is default. (Added in 7.10)
636 .IP CURLOPT_NOPROXY
637 Pass a pointer to a zero terminated string. The should be a comma- separated
638 list of hosts which do not use a proxy, if one is specified.  The only
639 wildcard is a single * character, which matches all hosts, and effectively
640 disables the proxy. Each name in this list is matched as either a domain which
641 contains the hostname, or the hostname itself. For example, local.com would
642 match local.com, local.com:80, and www.local.com, but not www.notlocal.com.
643 (Added in 7.19.4)
644 .IP CURLOPT_HTTPPROXYTUNNEL
645 Set the parameter to 1 to make the library tunnel all operations through a
646 given HTTP proxy. There is a big difference between using a proxy and to
647 tunnel through it. If you don't know what this means, you probably don't want
648 this tunneling option.
649 .IP CURLOPT_SOCKS5_GSSAPI_SERVICE
650 Pass a char * as parameter to a string holding the name of the service. The
651 default service name for a SOCKS5 server is rcmd/server-fqdn. This option
652 allows you to change it. (Added in 7.19.4)
653 .IP CURLOPT_SOCKS5_GSSAPI_NEC
654 Pass a long set to 1 to enable or 0 to disable. As part of the gssapi
655 negotiation a protection mode is negotiated. The rfc1961 says in section
656 4.3/4.4 it should be protected, but the NEC reference implementation does not.
657 If enabled, this option allows the unprotected exchange of the protection mode
658 negotiation. (Added in 7.19.4).
659 .IP CURLOPT_INTERFACE
660 Pass a char * as parameter. This sets the interface name to use as outgoing
661 network interface. The name can be an interface name, an IP address, or a host
662 name.
663 .IP CURLOPT_LOCALPORT
664 Pass a long. This sets the local port number of the socket used for
665 connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and
666 you are recommended to use \fICURLOPT_LOCALPORTRANGE\fP as well when this is
667 set. Valid port numbers are 1 - 65535. (Added in 7.15.2)
668 .IP CURLOPT_LOCALPORTRANGE
669 Pass a long. This is the number of attempts libcurl should make to find a
670 working local port number. It starts with the given \fICURLOPT_LOCALPORT\fP
671 and adds one to the number for each retry. Setting this to 1 or below will
672 make libcurl do only one try for the exact port number. Port numbers by nature
673 are scarce resources that will be busy at times so setting this value to
674 something too low might cause unnecessary connection setup failures. (Added in
675 7.15.2)
676 .IP CURLOPT_DNS_CACHE_TIMEOUT
677 Pass a long, this sets the timeout in seconds. Name resolves will be kept in
678 memory for this number of seconds. Set to zero to completely disable
679 caching, or set to -1 to make the cached entries remain forever. By default,
680 libcurl caches this info for 60 seconds.
681
682 The name resolve functions of various libc implementations don't re-read name
683 server information unless explicitly told so (for example, by calling
684 \fIres_init(3)\fP). This may cause libcurl to keep using the older server even
685 if DHCP has updated the server info, and this may look like a DNS cache issue
686 to the casual libcurl-app user.
687 .IP CURLOPT_DNS_USE_GLOBAL_CACHE
688 Pass a long. If the value is 1, it tells curl to use a global DNS cache
689 that will survive between easy handle creations and deletions. This is not
690 thread-safe and this will use a global variable.
691
692 \fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over
693 to using the share interface instead! See \fICURLOPT_SHARE\fP and
694 \fIcurl_share_init(3)\fP.
695 .IP CURLOPT_BUFFERSIZE
696 Pass a long specifying your preferred size (in bytes) for the receive buffer
697 in libcurl.  The main point of this would be that the write callback gets
698 called more often and with smaller chunks. This is just treated as a request,
699 not an order. You cannot be guaranteed to actually get the given size. (Added
700 in 7.10)
701
702 This size is by default set as big as possible (CURL_MAX_WRITE_SIZE), so it
703 only makes sense to use this option if you want it smaller.
704 .IP CURLOPT_PORT
705 Pass a long specifying what remote port number to connect to, instead of the
706 one specified in the URL or the default port for the used protocol.
707 .IP CURLOPT_TCP_NODELAY
708 Pass a long specifying whether the TCP_NODELAY option should be set or
709 cleared (1 = set, 0 = clear). The option is cleared by default. This
710 will have no effect after the connection has been established.
711
712 Setting this option will disable TCP's Nagle algorithm. The purpose of
713 this algorithm is to try to minimize the number of small packets on
714 the network (where "small packets" means TCP segments less than the
715 Maximum Segment Size (MSS) for the network).
716
717 Maximizing the amount of data sent per TCP segment is good because it
718 amortizes the overhead of the send. However, in some cases (most
719 notably telnet or rlogin) small segments may need to be sent
720 without delay. This is less efficient than sending larger amounts of
721 data at a time, and can contribute to congestion on the network if
722 overdone.
723 .IP CURLOPT_ADDRESS_SCOPE
724 Pass a long specifying the scope_id value to use when connecting to IPv6
725 link-local or site-local addresses. (Added in 7.19.0)
726 .SH NAMES and PASSWORDS OPTIONS (Authentication)
727 .IP CURLOPT_NETRC
728 This parameter controls the preference of libcurl between using user names and
729 passwords from your \fI~/.netrc\fP file, relative to user names and passwords
730 in the URL supplied with \fICURLOPT_URL\fP.
731
732 libcurl uses a user name (and supplied or prompted password) supplied with
733 \fICURLOPT_USERPWD\fP in preference to any of the options controlled by this
734 parameter.
735
736 Pass a long, set to one of the values described below.
737 .RS
738 .IP CURL_NETRC_OPTIONAL
739 The use of your \fI~/.netrc\fP file is optional, and information in the URL is
740 to be preferred.  The file will be scanned for the host and user name (to
741 find the password only) or for the host only, to find the first user name and
742 password after that \fImachine\fP, which ever information is not specified in
743 the URL.
744
745 Undefined values of the option will have this effect.
746 .IP CURL_NETRC_IGNORED
747 The library will ignore the file and use only the information in the URL.
748
749 This is the default.
750 .IP CURL_NETRC_REQUIRED
751 This value tells the library that use of the file is required, to ignore the
752 information in the URL, and to search the file for the host only.
753 .RE
754 Only machine name, user name and password are taken into account
755 (init macros and similar things aren't supported).
756
757 libcurl does not verify that the file has the correct properties set (as the
758 standard Unix ftp client does). It should only be readable by user.
759 .IP CURLOPT_NETRC_FILE
760 Pass a char * as parameter, pointing to a zero terminated string containing
761 the full path name to the file you want libcurl to use as .netrc file. If this
762 option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to
763 find a .netrc file in the current user's home directory. (Added in 7.10.9)
764 .IP CURLOPT_USERPWD
765 Pass a char * as parameter, which should be [user name]:[password] to use for
766 the connection. Use \fICURLOPT_HTTPAUTH\fP to decide the authentication method.
767
768 When using NTLM, you can set the domain by prepending it to the user name and
769 separating the domain and name with a forward (/) or backward slash (\\). Like
770 this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
771 Windows) support this style even for Basic authentication.
772
773 When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform
774 several requests to possibly different hosts. libcurl will only send this user
775 and password information to hosts using the initial host name (unless
776 \fICURLOPT_UNRESTRICTED_AUTH\fP is set), so if libcurl follows locations to
777 other hosts it will not send the user and password to those. This is enforced
778 to prevent accidental information leakage.
779 .IP CURLOPT_PROXYUSERPWD
780 Pass a char * as parameter, which should be [user name]:[password] to use for
781 the connection to the HTTP proxy.  Use \fICURLOPT_PROXYAUTH\fP to decide
782 the authentication method.
783 .IP CURLOPT_USERNAME
784 Pass a char * as parameter, which should be pointing to the zero terminated
785 user name to use for the transfer.
786
787 \fBCURLOPT_USERNAME\fP sets the user name to be used in protocol
788 authentication. You should not use this option together with the (older)
789 CURLOPT_USERPWD option.
790
791 In order to specify the password to be used in conjunction with the user name
792 use the \fICURLOPT_PASSWORD\fP option.  (Added in 7.19.1)
793 .IP CURLOPT_PASSWORD
794 Pass a char * as parameter, which should be pointing to the zero terminated
795 password to use for the transfer.
796
797 The CURLOPT_PASSWORD option should be used in conjunction with
798 the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1)
799 .IP CURLOPT_PROXYUSERNAME
800 Pass a char * as parameter, which should be pointing to the zero terminated
801 user name to use for the transfer while connecting to Proxy.
802
803 The CURLOPT_PROXYUSERNAME option should be used in same way as the
804 \fICURLOPT_PROXYUSERPWD\fP is used.  In comparison to
805 \fICURLOPT_PROXYUSERPWD\fP the CURLOPT_PROXYUSERNAME allows the username to
806 contain a colon, like in the following example: "sip:user@example.com". The
807 CURLOPT_PROXYUSERNAME option is an alternative way to set the user name while
808 connecting to Proxy.  There is no meaning to use it together with the
809 \fICURLOPT_PROXYUSERPWD\fP option.
810
811 In order to specify the password to be used in conjunction with the user name
812 use the \fICURLOPT_PROXYPASSWORD\fP option.  (Added in 7.19.1)
813 .IP CURLOPT_PROXYPASSWORD
814 Pass a char * as parameter, which should be pointing to the zero terminated
815 password to use for the transfer while connecting to Proxy.
816
817 The CURLOPT_PROXYPASSWORD option should be used in conjunction with
818 the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1)
819 .IP CURLOPT_HTTPAUTH
820 Pass a long as parameter, which is set to a bitmask, to tell libcurl which
821 authentication method(s) you want it to use. The available bits are listed
822 below. If more than one bit is set, libcurl will first query the site to see
823 which authentication methods it supports and then pick the best one you allow
824 it to use. For some methods, this will induce an extra network round-trip. Set
825 the actual name and password with the \fICURLOPT_USERPWD\fP option or
826 with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_USERPASSWORD\fP options.
827 (Added in 7.10.6)
828 .RS
829 .IP CURLAUTH_BASIC
830 HTTP Basic authentication. This is the default choice, and the only method
831 that is in wide-spread use and supported virtually everywhere. This sends
832 the user name and password over the network in plain text, easily captured by
833 others.
834 .IP CURLAUTH_DIGEST
835 HTTP Digest authentication.  Digest authentication is defined in RFC2617 and
836 is a more secure way to do authentication over public networks than the
837 regular old-fashioned Basic method.
838 .IP CURLAUTH_DIGEST_IE
839 HTTP Digest authentication with an IE flavor.  Digest authentication is
840 defined in RFC2617 and is a more secure way to do authentication over public
841 networks than the regular old-fashioned Basic method. The IE flavor is simply
842 that libcurl will use a special "quirk" that IE is known to have used before
843 version 7 and that some servers require the client to use. (This define was
844 added in 7.19.3)
845 .IP CURLAUTH_GSSNEGOTIATE
846 HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
847 \&"Negotiate") method was designed by Microsoft and is used in their web
848 applications. It is primarily meant as a support for Kerberos5 authentication
849 but may also be used along with other authentication methods. For more
850 information see IETF draft draft-brezak-spnego-http-04.txt.
851
852 You need to build libcurl with a suitable GSS-API library for this to work.
853 .IP CURLAUTH_NTLM
854 HTTP NTLM authentication. A proprietary protocol invented and used by
855 Microsoft. It uses a challenge-response and hash concept similar to Digest, to
856 prevent the password from being eavesdropped.
857
858 You need to build libcurl with OpenSSL support for this option to work, or
859 build libcurl on Windows.
860 .IP CURLAUTH_ANY
861 This is a convenience macro that sets all bits and thus makes libcurl pick any
862 it finds suitable. libcurl will automatically select the one it finds most
863 secure.
864 .IP CURLAUTH_ANYSAFE
865 This is a convenience macro that sets all bits except Basic and thus makes
866 libcurl pick any it finds suitable. libcurl will automatically select the one
867 it finds most secure.
868 .IP CURLAUTH_ONLY
869 This is a meta symbol. Or this value together with a single specific auth
870 value to force libcurl to probe for un-restricted auth and if not, only that
871 single auth algorithm is acceptable. (Added in 7.21.3)
872 .RE
873 .IP CURLOPT_PROXYAUTH
874 Pass a long as parameter, which is set to a bitmask, to tell libcurl which
875 authentication method(s) you want it to use for your proxy authentication.  If
876 more than one bit is set, libcurl will first query the site to see what
877 authentication methods it supports and then pick the best one you allow it to
878 use. For some methods, this will induce an extra network round-trip. Set the
879 actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The
880 bitmask can be constructed by or'ing together the bits listed above for the
881 \fICURLOPT_HTTPAUTH\fP option. As of this writing, only Basic, Digest and NTLM
882 work. (Added in 7.10.7)
883 .SH HTTP OPTIONS
884 .IP CURLOPT_AUTOREFERER
885 Pass a parameter set to 1 to enable this. When enabled, libcurl will
886 automatically set the Referer: field in requests where it follows a Location:
887 redirect.
888 .IP CURLOPT_ENCODING
889 Sets the contents of the Accept-Encoding: header sent in an HTTP request, and
890 enables decoding of a response when a Content-Encoding: header is received.
891 Three encodings are supported: \fIidentity\fP, which does nothing,
892 \fIdeflate\fP which requests the server to compress its response using the
893 zlib algorithm, and \fIgzip\fP which requests the gzip algorithm.  If a
894 zero-length string is set, then an Accept-Encoding: header containing all
895 supported encodings is sent.
896
897 This is a request, not an order; the server may or may not do it.  This option
898 must be set (to any non-NULL value) or else any unsolicited encoding done by
899 the server is ignored. See the special file lib/README.encoding for details.
900 .IP CURLOPT_FOLLOWLOCATION
901 A parameter set to 1 tells the library to follow any Location: header that the
902 server sends as part of an HTTP header.
903
904 This means that the library will re-send the same request on the new location
905 and follow new Location: headers all the way until no more such headers are
906 returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number of redirects
907 libcurl will follow.
908
909 Since 7.19.4, libcurl can limit what protocols it will automatically
910 follow. The accepted protocols are set with \fICURLOPT_REDIR_PROTOCOLS\fP and
911 it excludes the FILE protocol by default.
912 .IP CURLOPT_UNRESTRICTED_AUTH
913 A parameter set to 1 tells the library it can continue to send authentication
914 (user+password) when following locations, even when hostname changed. This
915 option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
916 .IP CURLOPT_MAXREDIRS
917 Pass a long. The set number will be the redirection limit. If that many
918 redirections have been followed, the next redirect will cause an error
919 (\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the
920 \fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1:
921 Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
922 an infinite number of redirects (which is the default)
923 .IP CURLOPT_POSTREDIR
924 Pass a bitmask to control how libcurl acts on redirects after POSTs that get a
925 301 or 302 response back.  A parameter with bit 0 set (value
926 \fBCURL_REDIR_POST_301\fP) tells the library to respect RFC 2616/10.3.2 and
927 not convert POST requests into GET requests when following a 301
928 redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain
929 the request method after a 302 redirect. CURL_REDIR_POST_ALL is a convenience
930 define that sets both bits.
931
932 The non-RFC behaviour is ubiquitous in web browsers, so the library does the
933 conversion by default to maintain consistency. However, a server may require a
934 POST to remain a POST after such a redirection. This option is meaningful only
935 when setting \fICURLOPT_FOLLOWLOCATION\fP.  (Added in 7.17.1) (This option was
936 known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 way before
937 then)
938 .IP CURLOPT_PUT
939 A parameter set to 1 tells the library to use HTTP PUT to transfer data. The
940 data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
941
942 This option is deprecated and starting with version 7.12.1 you should instead
943 use \fICURLOPT_UPLOAD\fP.
944 .IP CURLOPT_POST
945 A parameter set to 1 tells the library to do a regular HTTP post. This will
946 also make the library use a "Content-Type:
947 application/x-www-form-urlencoded" header. (This is by far the most commonly
948 used POST method).
949
950 Use one of \fICURLOPT_POSTFIELDS\fP or \fICURLOPT_COPYPOSTFIELDS\fP options to
951 specify what data to post and \fICURLOPT_POSTFIELDSIZE\fP or
952 \fICURLOPT_POSTFIELDSIZE_LARGE\fP to set the data size.
953
954 Optionally, you can provide data to POST using the \fICURLOPT_READFUNCTION\fP
955 and \fICURLOPT_READDATA\fP options but then you must make sure to not set
956 \fICURLOPT_POSTFIELDS\fP to anything but NULL. When providing data with a
957 callback, you must transmit it using chunked transfer-encoding or you must set
958 the size of the data with the \fICURLOPT_POSTFIELDSIZE\fP or
959 \fICURLOPT_POSTFIELDSIZE_LARGE\fP option. To enable chunked encoding, you
960 simply pass in the appropriate Transfer-Encoding header, see the
961 post-callback.c example.
962
963 You can override the default POST Content-Type: header by setting your own
964 with \fICURLOPT_HTTPHEADER\fP.
965
966 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
967 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
968
969 If you use POST to a HTTP 1.1 server, you can send data without knowing the
970 size before starting the POST if you use chunked encoding. You enable this by
971 adding a header like "Transfer-Encoding: chunked" with
972 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
973 specify the size in the request.
974
975 When setting \fICURLOPT_POST\fP to 1, it will automatically set
976 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
977
978 If you issue a POST request and then want to make a HEAD or GET using the same
979 re-used handle, you must explicitly set the new request type using
980 \fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar.
981 .IP CURLOPT_POSTFIELDS
982 Pass a void * as parameter, which should be the full data to post in an HTTP
983 POST operation. You must make sure that the data is formatted the way you want
984 the server to receive it. libcurl will not convert or encode it for you. Most
985 web servers will assume this data to be url-encoded.
986
987 The pointed data are NOT copied by the library: as a consequence, they must
988 be preserved by the calling application until the transfer finishes.
989
990 This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
991 set that Content-Type by default when this option is used), which is the most
992 commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
993 \fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP.
994
995 If you want to do a zero-byte POST, you need to set
996 \fICURLOPT_POSTFIELDSIZE\fP explicitly to zero, as simply setting
997 \fICURLOPT_POSTFIELDS\fP to NULL or "" just effectively disables the sending
998 of the specified string. libcurl will instead assume that you'll send the POST
999 data using the read callback!
1000
1001 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1002 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
1003
1004 To make multipart/formdata posts (aka RFC2388-posts), check out the
1005 \fICURLOPT_HTTPPOST\fP option.
1006 .IP CURLOPT_POSTFIELDSIZE
1007 If you want to post data to the server without letting libcurl do a strlen()
1008 to measure the data size, this option must be used. When this option is used
1009 you can post fully binary data, which otherwise is likely to fail. If this
1010 size is set to -1, the library will use strlen() to get the size.
1011 .IP CURLOPT_POSTFIELDSIZE_LARGE
1012 Pass a curl_off_t as parameter. Use this to set the size of the
1013 \fICURLOPT_POSTFIELDS\fP data to prevent libcurl from doing strlen() on the
1014 data to figure out the size. This is the large file version of the
1015 \fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1)
1016 .IP CURLOPT_COPYPOSTFIELDS
1017 Pass a char * as parameter, which should be the full data to post in an HTTP
1018 POST operation. It behaves as the \fICURLOPT_POSTFIELDS\fP option, but the
1019 original data are copied by the library, allowing the application to overwrite
1020 the original data after setting this option.
1021
1022 Because data are copied, care must be taken when using this option in
1023 conjunction with \fICURLOPT_POSTFIELDSIZE\fP or
1024 \fICURLOPT_POSTFIELDSIZE_LARGE\fP: If the size has not been set prior to
1025 \fICURLOPT_COPYPOSTFIELDS\fP, the data are assumed to be a NUL-terminated
1026 string; else the stored size informs the library about the data byte count to
1027 copy. In any case, the size must not be changed after
1028 \fICURLOPT_COPYPOSTFIELDS\fP, unless another \fICURLOPT_POSTFIELDS\fP or
1029 \fICURLOPT_COPYPOSTFIELDS\fP option is issued.
1030 (Added in 7.17.1)
1031 .IP CURLOPT_HTTPPOST
1032 Tells libcurl you want a multipart/formdata HTTP POST to be made and you
1033 instruct what data to pass on to the server.  Pass a pointer to a linked list
1034 of curl_httppost structs as parameter.  The easiest way to create such a
1035 list, is to use \fIcurl_formadd(3)\fP as documented. The data in this list
1036 must remain intact until you close this curl handle again with
1037 \fIcurl_easy_cleanup(3)\fP.
1038
1039 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1040 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
1041
1042 When setting \fICURLOPT_HTTPPOST\fP, it will automatically set
1043 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
1044 .IP CURLOPT_REFERER
1045 Pass a pointer to a zero terminated string as parameter. It will be used to
1046 set the Referer: header in the http request sent to the remote server. This
1047 can be used to fool servers or scripts. You can also set any custom header
1048 with \fICURLOPT_HTTPHEADER\fP.
1049 .IP CURLOPT_USERAGENT
1050 Pass a pointer to a zero terminated string as parameter. It will be used to
1051 set the User-Agent: header in the http request sent to the remote server. This
1052 can be used to fool servers or scripts. You can also set any custom header
1053 with \fICURLOPT_HTTPHEADER\fP.
1054 .IP CURLOPT_HTTPHEADER
1055 Pass a pointer to a linked list of HTTP headers to pass to the server in your
1056 HTTP request. The linked list should be a fully valid list of \fBstruct
1057 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
1058 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire
1059 list. If you add a header that is otherwise generated and used by libcurl
1060 internally, your added one will be used instead. If you add a header with no
1061 content as in 'Accept:' (no data on the right side of the colon), the
1062 internally used header will get disabled. Thus, using this option you can add
1063 new headers, replace internal headers and remove internal headers. To add a
1064 header with no content, make the content be two quotes: \&"". The headers
1065 included in the linked list must not be CRLF-terminated, because curl adds
1066 CRLF after each header item. Failure to comply with this will result in
1067 strange bugs because the server will most likely ignore part of the headers
1068 you specified.
1069
1070 The first line in a request (containing the method, usually a GET or POST) is
1071 not a header and cannot be replaced using this option. Only the lines
1072 following the request-line are headers. Adding this method line in this list
1073 of headers will only cause your request to send an invalid header.
1074
1075 Pass a NULL to this to reset back to no custom headers.
1076
1077 The most commonly replaced headers have "shortcuts" in the options
1078 \fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
1079 .IP CURLOPT_HTTP200ALIASES
1080 Pass a pointer to a linked list of aliases to be treated as valid HTTP 200
1081 responses.  Some servers respond with a custom header response line.  For
1082 example, IceCast servers respond with "ICY 200 OK".  By including this string
1083 in your list of aliases, the response will be treated as a valid HTTP header
1084 line such as "HTTP/1.0 200 OK". (Added in 7.10.3)
1085
1086 The linked list should be a fully valid list of struct curl_slist structs, and
1087 be properly filled in.  Use \fIcurl_slist_append(3)\fP to create the list and
1088 \fIcurl_slist_free_all(3)\fP to clean up an entire list.
1089
1090 The alias itself is not parsed for any version strings. Before libcurl 7.16.3,
1091 Libcurl used the value set by option \fICURLOPT_HTTP_VERSION\fP, but starting
1092 with 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched.
1093 .IP CURLOPT_COOKIE
1094 Pass a pointer to a zero terminated string as parameter. It will be used to
1095 set a cookie in the http request. The format of the string should be
1096 NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie
1097 should contain.
1098
1099 If you need to set multiple cookies, you need to set them all using a single
1100 option and thus you need to concatenate them all in one single string. Set
1101 multiple cookies in one string like this: "name1=content1; name2=content2;"
1102 etc.
1103
1104 This option sets the cookie header explictly in the outgoing request(s). If
1105 multiple requests are done due to authentication, followed redirections or
1106 similar, they will all get this cookie passed on.
1107
1108 Using this option multiple times will only make the latest string override the
1109 previous ones.
1110 .IP CURLOPT_COOKIEFILE
1111 Pass a pointer to a zero terminated string as parameter. It should contain the
1112 name of your file holding cookie data to read. The cookie data may be in
1113 Netscape / Mozilla cookie data format or just regular HTTP-style headers
1114 dumped to a file.
1115
1116 Given an empty or non-existing file or by passing the empty string (""), this
1117 option will enable cookies for this curl handle, making it understand and
1118 parse received cookies and then use matching cookies in future requests.
1119
1120 If you use this option multiple times, you just add more files to read.
1121 Subsequent files will add more cookies.
1122 .IP CURLOPT_COOKIEJAR
1123 Pass a file name as char *, zero terminated. This will make libcurl write all
1124 internally known cookies to the specified file when \fIcurl_easy_cleanup(3)\fP
1125 is called. If no cookies are known, no file will be created. Specify "-" to
1126 instead have the cookies written to stdout. Using this option also enables
1127 cookies for this session, so if you for example follow a location it will make
1128 matching cookies get sent accordingly.
1129
1130 If the cookie jar file can't be created or written to (when the
1131 \fIcurl_easy_cleanup(3)\fP is called), libcurl will not and cannot report an
1132 error for this. Using \fICURLOPT_VERBOSE\fP or \fICURLOPT_DEBUGFUNCTION\fP
1133 will get a warning to display, but that is the only visible feedback you get
1134 about this possibly lethal situation.
1135 .IP CURLOPT_COOKIESESSION
1136 Pass a long set to 1 to mark this as a new cookie "session". It will force
1137 libcurl to ignore all cookies it is about to load that are "session cookies"
1138 from the previous session. By default, libcurl always stores and loads all
1139 cookies, independent if they are session cookies or not. Session cookies are
1140 cookies without expiry date and they are meant to be alive and existing for
1141 this "session" only.
1142 .IP CURLOPT_COOKIELIST
1143 Pass a char * to a cookie string. Cookie can be either in Netscape / Mozilla
1144 format or just regular HTTP-style header (Set-Cookie: ...) format. If cURL
1145 cookie engine was not enabled it will enable its cookie engine.  Passing a
1146 magic string \&"ALL" will erase all cookies known by cURL. (Added in 7.14.1)
1147 Passing the special string \&"SESS" will only erase all session cookies known
1148 by cURL. (Added in 7.15.4) Passing the special string \&"FLUSH" will write
1149 all cookies known by cURL to the file specified by \fICURLOPT_COOKIEJAR\fP.
1150 (Added in 7.17.1)
1151 .IP CURLOPT_HTTPGET
1152 Pass a long. If the long is 1, this forces the HTTP request to get back
1153 to GET. Usable if a POST, HEAD, PUT, or a custom request has been used
1154 previously using the same curl handle.
1155
1156 When setting \fICURLOPT_HTTPGET\fP to 1, it will automatically set
1157 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
1158 .IP CURLOPT_HTTP_VERSION
1159 Pass a long, set to one of the values described below. They force libcurl to
1160 use the specific HTTP versions. This is not sensible to do unless you have a
1161 good reason.
1162 .RS
1163 .IP CURL_HTTP_VERSION_NONE
1164 We don't care about what version the library uses. libcurl will use whatever
1165 it thinks fit.
1166 .IP CURL_HTTP_VERSION_1_0
1167 Enforce HTTP 1.0 requests.
1168 .IP CURL_HTTP_VERSION_1_1
1169 Enforce HTTP 1.1 requests.
1170 .RE
1171 .IP CURLOPT_IGNORE_CONTENT_LENGTH
1172 Ignore the Content-Length header. This is useful for Apache 1.x (and similar
1173 servers) which will report incorrect content length for files over 2
1174 gigabytes. If this option is used, curl will not be able to accurately report
1175 progress, and will simply stop the download when the server ends the
1176 connection. (added in 7.14.1)
1177 .IP CURLOPT_HTTP_CONTENT_DECODING
1178 Pass a long to tell libcurl how to act on content decoding. If set to zero,
1179 content decoding will be disabled. If set to 1 it is enabled. Libcurl has no
1180 default content decoding but requires you to use \fICURLOPT_ENCODING\fP for
1181 that. (added in 7.16.2)
1182 .IP CURLOPT_HTTP_TRANSFER_DECODING
1183 Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
1184 transfer decoding will be disabled, if set to 1 it is enabled
1185 (default). libcurl does chunked transfer decoding by default unless this
1186 option is set to zero. (added in 7.16.2)
1187 .SH SMTP OPTIONS
1188 .IP CURLOPT_MAIL_FROM
1189 Pass a pointer to a zero terminated string as parameter. It will be used to
1190 specify the sender address in a mail when sending an SMTP mail with libcurl.
1191
1192 (Added in 7.20.0)
1193 .IP CURLOPT_MAIL_RCPT
1194 Pass a pointer to a linked list of recipients to pass to the server in your
1195 SMTP mail request.  The linked list should be a fully valid list of \fBstruct
1196 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
1197 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list.
1198
1199 Each recipient in SMTP lingo is specified with angle brackets (<>), but should
1200 you not use an angle bracket as first letter libcurl will assume you provide a
1201 single email address only and enclose that with angle brackets for you.
1202
1203 (Added in 7.20.0)
1204 .SH TFTP OPTIONS
1205 .IP CURLOPT_TFTP_BLKSIZE
1206 Specify block size to use for TFTP data transmission. Valid range as per RFC
1207 2348 is 8-65464 bytes. The default of 512 bytes will be used if this option is
1208 not specified. The specified block size will only be used pending support by
1209 the remote server. If the server does not return an option acknowledgement or
1210 returns an option acknowledgement with no blksize, the default of 512 bytes
1211 will be used. (added in 7.19.4)
1212 .SH FTP OPTIONS
1213 .IP CURLOPT_FTPPORT
1214 Pass a pointer to a zero terminated string as parameter. It will be used to
1215 get the IP address to use for the FTP PORT instruction. The PORT instruction
1216 tells the remote server to connect to our specified IP address. The string may
1217 be a plain IP address, a host name, a network interface name (under Unix) or
1218 just a '-' symbol to let the library use your system's default IP
1219 address. Default FTP operations are passive, and thus won't use PORT.
1220
1221 The address can be followed by a ':' to specify a port, optionally followed by
1222 a '-' to specify a port range.  If the port specified is 0, the operating
1223 system will pick a free port.  If a range is provided and all ports in the
1224 range are not available, libcurl will report CURLE_FTP_PORT_FAILED for the
1225 handle.  Invalid port/range settings are ignored.  IPv6 addresses followed by
1226 a port or portrange have to be in brackets.  IPv6 addresses without port/range
1227 specifier can be in brackets.  (added in 7.19.5)
1228
1229 Examples with specified ports:
1230
1231 .nf
1232   eth0:0
1233   192.168.1.2:32000-33000
1234   curl.se:32123
1235   [::1]:1234-4567
1236 .fi
1237
1238 You disable PORT again and go back to using the passive version by setting
1239 this option to NULL.
1240 .IP CURLOPT_QUOTE
1241 Pass a pointer to a linked list of FTP or SFTP commands to pass to
1242 the server prior to your FTP request. This will be done before any
1243 other commands are issued (even before the CWD command for FTP). The
1244 linked list should be a fully valid list of 'struct curl_slist' structs
1245 properly filled in with text strings. Use \fIcurl_slist_append(3)\fP
1246 to append strings (commands) to the list, and clear the entire list
1247 afterwards with \fIcurl_slist_free_all(3)\fP. Disable this operation
1248 again by setting a NULL to this option.
1249 The set of valid FTP commands depends on the server (see RFC959 for a
1250 list of mandatory commands).
1251 The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd,
1252 rename, rm, rmdir, symlink (see
1253 .BR curl (1))
1254 (SFTP support added in 7.16.3)
1255 .IP CURLOPT_POSTQUOTE
1256 Pass a pointer to a linked list of FTP or SFTP commands to pass to the server
1257 after your FTP transfer request. The commands will only be run if no error
1258 occurred. The linked list should be a fully valid list of struct curl_slist
1259 structs properly filled in as described for \fICURLOPT_QUOTE\fP. Disable this
1260 operation again by setting a NULL to this option.
1261 .IP CURLOPT_PREQUOTE
1262 Pass a pointer to a linked list of FTP commands to pass to the server after
1263 the transfer type is set. The linked list should be a fully valid list of
1264 struct curl_slist structs properly filled in as described for
1265 \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this
1266 option. Before version 7.15.6, if you also set \fICURLOPT_NOBODY\fP to 1, this
1267 option didn't work.
1268 .IP CURLOPT_DIRLISTONLY
1269 A parameter set to 1 tells the library to just list the names of files in a
1270 directory, instead of doing a full directory listing that would include file
1271 sizes, dates etc. This works for FTP and SFTP URLs.
1272
1273 This causes an FTP NLST command to be sent on an FTP server.  Beware that some
1274 FTP servers list only files in their response to NLST; they might not include
1275 subdirectories and symbolic links.
1276
1277 Setting this option to 1 also implies a directory listing even if the URL
1278 doesn't end with a slash, which otherwise is necessary.
1279
1280 Do NOT use this option if you also use \fICURLOPT_WILDCARDMATCH\fP as it will
1281 effectively break that feature then.
1282
1283 (This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)
1284 .IP CURLOPT_APPEND
1285 A parameter set to 1 tells the library to append to the remote file instead of
1286 overwrite it. This is only useful when uploading to an FTP site.
1287
1288 (This option was known as CURLOPT_FTPAPPEND up to 7.16.4)
1289 .IP CURLOPT_FTP_USE_EPRT
1290 Pass a long. If the value is 1, it tells curl to use the EPRT (and
1291 LPRT) command when doing active FTP downloads (which is enabled by
1292 \fICURLOPT_FTPPORT\fP). Using EPRT means that it will first attempt to use
1293 EPRT and then LPRT before using PORT, but if you pass zero to this
1294 option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)
1295
1296 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
1297 .IP CURLOPT_FTP_USE_EPSV
1298 Pass a long. If the value is 1, it tells curl to use the EPSV command
1299 when doing passive FTP downloads (which it always does by default). Using EPSV
1300 means that it will first attempt to use EPSV before using PASV, but if you
1301 pass zero to this option, it will not try using EPSV, only plain PASV.
1302
1303 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
1304 .IP CURLOPT_FTP_USE_PRET
1305 Pass a long. If the value is 1, it tells curl to send a PRET command before
1306 PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard
1307 command for directory listings as well as up and downloads in PASV mode. Has
1308 no effect when using the active FTP transfers mode.  (Added in 7.20.0)
1309 .IP CURLOPT_FTP_CREATE_MISSING_DIRS
1310 Pass a long. If the value is 1, curl will attempt to create any remote
1311 directory that it fails to CWD into. CWD is the command that changes working
1312 directory. (Added in 7.10.7)
1313
1314 This setting also applies to SFTP-connections. curl will attempt to create
1315 the remote directory if it can't obtain a handle to the target-location. The
1316 creation will fail if a file of the same name as the directory to create
1317 already exists or lack of permissions prevents creation. (Added in 7.16.3)
1318
1319 Starting with 7.19.4, you can also set this value to 2, which will make
1320 libcurl retry the CWD command again if the subsequent MKD command fails. This
1321 is especially useful if you're doing many simultanoes connections against the
1322 same server and they all have this option enabled, as then CWD may first fail
1323 but then another connection does MKD before this connection and thus MKD fails
1324 but trying CWD works! 7.19.4 also introduced the \fICURLFTP_CREATE_DIR\fP and
1325 \fICURLFTP_CREATE_DIR_RETRY\fP enum names for these arguments.
1326
1327 Before version 7.19.4, libcurl will simply ignore arguments set to 2 and act
1328 as if 1 was selected.
1329 .IP CURLOPT_FTP_RESPONSE_TIMEOUT
1330 Pass a long.  Causes curl to set a timeout period (in seconds) on the amount
1331 of time that the server is allowed to take in order to generate a response
1332 message for a command before the session is considered hung.  While curl is
1333 waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is
1334 recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
1335 \fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
1336 \fICURLOPT_TIMEOUT\fP.  (Added in 7.10.8)
1337 .IP CURLOPT_FTP_ALTERNATIVE_TO_USER
1338 Pass a char * as parameter, pointing to a string which will be used to
1339 authenticate if the usual FTP "USER user" and "PASS password" negotiation
1340 fails. This is currently only known to be required when connecting to
1341 Tumbleweed's Secure Transport FTPS server using client certificates for
1342 authentication. (Added in 7.15.5)
1343 .IP CURLOPT_FTP_SKIP_PASV_IP
1344 Pass a long. If set to 1, it instructs libcurl to not use the IP address the
1345 server suggests in its 227-response to libcurl's PASV command when libcurl
1346 connects the data connection. Instead libcurl will re-use the same IP address
1347 it already uses for the control connection. But it will use the port number
1348 from the 227-response. (Added in 7.14.2)
1349
1350 This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
1351 .IP CURLOPT_FTPSSLAUTH
1352 Pass a long using one of the values from below, to alter how libcurl issues
1353 \&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
1354 \fICURLOPT_USE_SSL\fP). (Added in 7.12.2)
1355 .RS
1356 .IP CURLFTPAUTH_DEFAULT
1357 Allow libcurl to decide.
1358 .IP CURLFTPAUTH_SSL
1359 Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
1360 .IP CURLFTPAUTH_TLS
1361 Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
1362 .RE
1363 .IP CURLOPT_FTP_SSL_CCC
1364 If enabled, this option makes libcurl use CCC (Clear Command Channel). It
1365 shuts down the SSL/TLS layer after authenticating. The rest of the
1366 control channel communication will be unencrypted. This allows NAT routers
1367 to follow the FTP transaction. Pass a long using one of the values below.
1368 (Added in 7.16.1)
1369 .RS
1370 .IP CURLFTPSSL_CCC_NONE
1371 Don't attempt to use CCC.
1372 .IP CURLFTPSSL_CCC_PASSIVE
1373 Do not initiate the shutdown, but wait for the server to do it. Do not send
1374 a reply.
1375 .IP CURLFTPSSL_CCC_ACTIVE
1376 Initiate the shutdown and wait for a reply.
1377 .RE
1378 .IP CURLOPT_FTP_ACCOUNT
1379 Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
1380 server asks for "account data" after user name and password has been provided,
1381 this data is sent off using the ACCT command. (Added in 7.13.0)
1382 .IP CURLOPT_FTP_FILEMETHOD
1383 Pass a long that should have one of the following values. This option controls
1384 what method libcurl should use to reach a file on a FTP(S) server. The
1385 argument should be one of the following alternatives:
1386 .RS
1387 .IP CURLFTPMETHOD_MULTICWD
1388 libcurl does a single CWD operation for each path part in the given URL. For
1389 deep hierarchies this means many commands. This is how RFC1738 says it
1390 should be done. This is the default but the slowest behavior.
1391 .IP CURLFTPMETHOD_NOCWD
1392 libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
1393 full path to the server for all these commands. This is the fastest behavior.
1394 .IP CURLFTPMETHOD_SINGLECWD
1395 libcurl does one CWD with the full target directory and then operates on the
1396 file \&"normally" (like in the multicwd case). This is somewhat more standards
1397 compliant than 'nocwd' but without the full penalty of 'multicwd'.
1398 .RE
1399 (Added in 7.15.1)
1400 .SH RTSP OPTIONS
1401 .IP CURLOPT_RTSP_REQUEST
1402 Tell libcurl what kind of RTSP request to make. Pass one of the following RTSP
1403 enum values. Unless noted otherwise, commands require the Session ID to be
1404 initialized. (Added in 7.20.0)
1405 .RS
1406 .IP CURL_RTSPREQ_OPTIONS
1407 Used to retrieve the available methods of the server. The application is
1408 responsbile for parsing and obeying the response. \fB(The session ID is not
1409 needed for this method.)\fP  (Added in 7.20.0)
1410 .IP CURL_RTSPREQ_DESCRIBE
1411 Used to get the low level description of a stream. The application should note
1412 what formats it understands in the \fI'Accept:'\fP header. Unless set
1413 manually, libcurl will automatically fill in \fI'Accept:
1414 application/sdp'\fP. Time-condition headers will be added to Describe requests
1415 if the \fICURLOPT_TIMECONDITION\fP option is active. \fB(The session ID is not
1416 needed for this method)\fP  (Added in 7.20.0)
1417 .IP CURL_RTSPREQ_ANNOUNCE
1418 When sent by a client, this method changes the description of the session. For
1419 example, if a client is using the server to record a meeting, the client can
1420 use Announce to inform the server of all the meta-information about the
1421 session.  ANNOUNCE acts like an HTTP PUT or POST just like
1422 \fICURL_RTSPREQ_SET_PARAMETER\fP (Added in 7.20.0)
1423 .IP CURL_RTSPREQ_SETUP
1424 Setup is used to initialize the transport layer for the session. The
1425 application must set the desired Transport options for a session by using the
1426 \fICURLOPT_RTSP_TRANSPORT\fP option prior to calling setup. If no session ID
1427 is currently set with \fICURLOPT_RTSP_SESSION_ID\fP, libcurl will extract and
1428 use the session ID in the response to this request. \fB(The session ID is not
1429 needed for this method).\fP  (Added in 7.20.0)
1430 .IP CURL_RTSPREQ_PLAY
1431 Send a Play command to the server. Use the \fICURLOPT_RANGE\fP option to
1432 modify the playback time (e.g. 'npt=10-15').  (Added in 7.20.0)
1433 .IP CURL_RTSPREQ_PAUSE
1434 Send a Pause command to the server. Use the \fICURLOPT_RANGE\fP option with a
1435 single value to indicate when the stream should be halted. (e.g. npt='25')
1436 (Added in 7.20.0)
1437 .IP CURL_RTSPREQ_TEARDOWN
1438 This command terminates an RTSP session. Simply closing a connection does not
1439 terminate the RTSP session since it is valid to control an RTSP session over
1440 different connections.  (Added in 7.20.0)
1441 .IP CURL_RTSPREQ_GET_PARAMETER
1442 Retrieve a parameter from the server. By default, libcurl will automatically
1443 include a \fIContent-Type: text/parameters\fP header on all non-empty requests
1444 unless a custom one is set. GET_PARAMETER acts just like an HTTP PUT or POST
1445 (see \fICURL_RTSPREQ_SET_PARAMETER\fP).
1446 Applications wishing to send a heartbeat message (e.g. in the presence of a
1447 server-specified timeout) should send use an empty GET_PARAMETER request.
1448 (Added in 7.20.0)
1449 .IP CURL_RTSPREQ_SET_PARAMETER
1450 Set a parameter on the server. By default, libcurl will automatically include
1451 a \fIContent-Type: text/parameters\fP header unless a custom one is set. The
1452 interaction with SET_PARAMTER is much like an HTTP PUT or POST. An application
1453 may either use \fICURLOPT_UPLOAD\fP with \fICURLOPT_READDATA\fP like an HTTP
1454 PUT, or it may use \fICURLOPT_POSTFIELDS\fP like an HTTP POST. No chunked
1455 transfers are allowed, so the application must set the
1456 \fICURLOPT_INFILESIZE\fP in the former and \fICURLOPT_POSTFIELDSIZE\fP in the
1457 latter. Also, there is no use of multi-part POSTs within RTSP. (Added in
1458 7.20.0)
1459 .IP CURL_RTSPREQ_RECORD
1460 Used to tell the server to record a session. Use the \fICURLOPT_RANGE\fP
1461 option to modify the record time. (Added in 7.20.0)
1462 .IP CURL_RTSPREQ_RECEIVE
1463 This is a special request because it does not send any data to the server. The
1464 application may call this function in order to receive interleaved RTP
1465 data. It will return after processing one read buffer of data in order to give
1466 the application a chance to run. (Added in 7.20.0)
1467 .RE
1468 .IP CURLOPT_RTSP_SESSION_ID
1469 Pass a char * as a parameter to set the value of the current RTSP Session ID
1470 for the handle. Useful for resuming an in-progress session. Once this value is
1471 set to any non-NULL value, libcurl will return \fICURLE_RTSP_SESSION_ERROR\fP
1472 if ID received from the server does not match. If unset (or set to NULL),
1473 libcurl will automatically set the ID the first time the server sets it in a
1474 response. (Added in 7.20.0)
1475 .IP CURLOPT_RTSP_STREAM_URI
1476 Set the stream URI to operate on by passing a char * . For example, a single
1477 session may be controlling \fIrtsp://foo/twister/audio\fP and
1478 \fIrtsp://foo/twister/video\fP and the application can switch to the
1479 appropriate stream using this option. If unset, libcurl will default to
1480 operating on generic server options by passing '*' in the place of the RTSP
1481 Stream URI. This option is distinct from \fICURLOPT_URL\fP. When working with
1482 RTSP, the \fICURLOPT_STREAM_URI\fP indicates what URL to send to the server in
1483 the request header while the \fICURLOPT_URL\fP indicates where to make the
1484 connection to.  (e.g. the \fICURLOPT_URL\fP for the above examples might be
1485 set to \fIrtsp://foo/twister\fP (Added in 7.20.0)
1486 .IP CURLOPT_RTSP_TRANSPORT
1487 Pass a char * to tell libcurl what to pass for the Transport: header for this
1488 RTSP session. This is mainly a convenience method to avoid needing to set a
1489 custom Transport: header for every SETUP request. The application must set a
1490 Transport: header before issuing a SETUP request. (Added in 7.20.0)
1491 .IP CURLOPT_RTSP_HEADER
1492 This option is simply an alias for \fICURLOPT_HTTP_HEADER\fP. Use this to
1493 replace the standard headers that RTSP and HTTP share. It is also valid to use
1494 the shortcuts such as \fICURLOPT_USERAGENT\fP. (Added in 7.20.0)
1495 .IP CURLOPT_RTSP_CLIENT_CSEQ
1496 Manually set the the CSEQ number to issue for the next RTSP request. Useful if
1497 the application is resuming a previously broken connection. The CSEQ will
1498 increment from this new number henceforth. (Added in 7.20.0)
1499 .IP CURLOPT_RTSP_SERVER_CSEQ
1500 Manually set the CSEQ number to expect for the next RTSP Server->Client
1501 request.  At the moment, this feature (listening for Server requests) is
1502 unimplemented. (Added in 7.20.0)
1503 .SH PROTOCOL OPTIONS
1504 .IP CURLOPT_TRANSFERTEXT
1505 A parameter set to 1 tells the library to use ASCII mode for FTP transfers,
1506 instead of the default binary transfer. For win32 systems it does not set the
1507 stdout to binary mode. This option can be usable when transferring text data
1508 between systems with different views on certain characters, such as newlines
1509 or similar.
1510
1511 libcurl does not do a complete ASCII conversion when doing ASCII transfers
1512 over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
1513 simply sets the mode to ASCII and performs a standard transfer.
1514 .IP CURLOPT_PROXY_TRANSFER_MODE
1515 Pass a long. If the value is set to 1 (one), it tells libcurl to set the
1516 transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by
1517 appending ;type=a or ;type=i to the URL. Without this setting, or it being set
1518 to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT\fP has no effect when doing
1519 FTP via a proxy. Beware that not all proxies support this feature.  (Added in
1520 7.18.0)
1521 .IP CURLOPT_CRLF
1522 Pass a long. If the value is set to 1 (one), libcurl converts Unix newlines to
1523 CRLF newlines on transfers. Disable this option again by setting the value to
1524 0 (zero).
1525 .IP CURLOPT_RANGE
1526 Pass a char * as parameter, which should contain the specified range you
1527 want. It should be in the format "X-Y", where X or Y may be left out. HTTP
1528 transfers also support several intervals, separated with commas as in
1529 \fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP
1530 server to send the response document in pieces (using standard MIME separation
1531 techniques). For RTSP, the formatting of a range should follow RFC 2326
1532 Section 12.29. For RTSP, byte ranges are \fBnot\fP permitted. Instead, ranges
1533 should be given in npt, utc, or smpte formats.
1534
1535 Pass a NULL to this option to disable the use of ranges.
1536
1537 Ranges work on HTTP, FTP, FILE (since 7.18.0), and RTSP (since 7.20.0)
1538 transfers only.
1539 .IP CURLOPT_RESUME_FROM
1540 Pass a long as parameter. It contains the offset in number of bytes that you
1541 want the transfer to start from. Set this option to 0 to make the transfer
1542 start from the beginning (effectively disabling resume). For FTP, set this
1543 option to -1 to make the transfer start from the end of the target file
1544 (useful to continue an interrupted upload).
1545
1546 When doing uploads with FTP, the resume position is where in the local/source
1547 file libcurl should try to resume the upload from and it will then append the
1548 source file to the remote target file.
1549 .IP CURLOPT_RESUME_FROM_LARGE
1550 Pass a curl_off_t as parameter. It contains the offset in number of bytes that
1551 you want the transfer to start from. (Added in 7.11.0)
1552 .IP CURLOPT_CUSTOMREQUEST
1553 Pass a pointer to a zero terminated string as parameter. It will be used
1554 instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
1555 when doing a FTP directory listing. This is useful for doing DELETE or other
1556 more or less obscure HTTP requests. Don't do this at will, make sure your
1557 server supports the command first.
1558
1559 When you change the request method by setting \fBCURLOPT_CUSTOMREQUEST\fP to
1560 something, you don't actually change how libcurl behaves or acts in regards to
1561 the particular request method, it will only change the actual string sent in
1562 the request.
1563
1564 For example: if you tell libcurl to do a HEAD request, but then change the
1565 request to a "GET" with \fBCURLOPT_CUSTOMREQUEST\fP you'll still see libcurl
1566 act as if it sent a HEAD even when it does send a GET.
1567
1568 To switch to a proper HEAD, use \fICURLOPT_NOBODY\fP, to switch to a proper
1569 POST, use \fICURLOPT_POST\fP or \fICURLOPT_POSTFIELDS\fP and so on.
1570
1571 Restore to the internal default by setting this to NULL.
1572
1573 Many people have wrongly used this option to replace the entire request with
1574 their own, including multiple headers and POST contents. While that might work
1575 in many cases, it will cause libcurl to send invalid requests and it could
1576 possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
1577 \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
1578 replace or extend the set of headers sent by libcurl. Use
1579 \fICURLOPT_HTTP_VERSION\fP to change HTTP version.
1580 .IP CURLOPT_FILETIME
1581 Pass a long. If it is 1, libcurl will attempt to get the modification date of
1582 the remote document in this operation. This requires that the remote server
1583 sends the time or replies to a time querying command. The
1584 \fIcurl_easy_getinfo(3)\fP function with the \fICURLINFO_FILETIME\fP argument
1585 can be used after a transfer to extract the received time (if any).
1586 .IP CURLOPT_NOBODY
1587 A parameter set to 1 tells the library to not include the body-part in the
1588 output. This is only relevant for protocols that have separate header and body
1589 parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
1590
1591 To change request to GET, you should use \fICURLOPT_HTTPGET\fP. Change request
1592 to POST with \fICURLOPT_POST\fP etc.
1593 .IP CURLOPT_INFILESIZE
1594 When uploading a file to a remote site, this option should be used to tell
1595 libcurl what the expected size of the infile is. This value should be passed
1596 as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP.
1597
1598 For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is
1599 mandatory.
1600
1601 This option does not limit how much data libcurl will actually send, as that
1602 is controlled entirely by what the read callback returns.
1603 .IP CURLOPT_INFILESIZE_LARGE
1604 When uploading a file to a remote site, this option should be used to tell
1605 libcurl what the expected size of the infile is.  This value should be passed
1606 as a curl_off_t. (Added in 7.11.0)
1607
1608 For uploading using SCP, this option or \fICURLOPT_INFILESIZE\fP is mandatory.
1609
1610 This option does not limit how much data libcurl will actually send, as that
1611 is controlled entirely by what the read callback returns.
1612 .IP CURLOPT_UPLOAD
1613 A parameter set to 1 tells the library to prepare for an upload. The
1614 \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP or
1615 \fICURLOPT_INFILESIZE_LARGE\fP options are also interesting for uploads. If
1616 the protocol is HTTP, uploading means using the PUT request unless you tell
1617 libcurl otherwise.
1618
1619 Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1620 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
1621
1622 If you use PUT to a HTTP 1.1 server, you can upload data without knowing the
1623 size before starting the transfer if you use chunked encoding. You enable this
1624 by adding a header like "Transfer-Encoding: chunked" with
1625 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
1626 specify the size.
1627 .IP CURLOPT_MAXFILESIZE
1628 Pass a long as parameter. This allows you to specify the maximum size (in
1629 bytes) of a file to download. If the file requested is larger than this value,
1630 the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned.
1631
1632 The file size is not always known prior to download, and for such files this
1633 option has no effect even if the file transfer ends up being larger than this
1634 given limit. This concerns both FTP and HTTP transfers.
1635 .IP CURLOPT_MAXFILESIZE_LARGE
1636 Pass a curl_off_t as parameter. This allows you to specify the maximum size
1637 (in bytes) of a file to download. If the file requested is larger than this
1638 value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be
1639 returned. (Added in 7.11.0)
1640
1641 The file size is not always known prior to download, and for such files this
1642 option has no effect even if the file transfer ends up being larger than this
1643 given limit. This concerns both FTP and HTTP transfers.
1644 .IP CURLOPT_TIMECONDITION
1645 Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
1646 value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
1647 or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP, FTP, and
1648 RTSP.
1649
1650 The last modification time of a file is not always known and in such instances
1651 this feature will have no effect even if the given time condition would not
1652 have been met. \fIcurl_easy_getinfo(3)\fP with the
1653 \fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if
1654 a zero-byte successful "transfer" was due to this condition not matching.
1655 .IP CURLOPT_TIMEVALUE
1656 Pass a long as parameter. This should be the time in seconds since 1 Jan 1970,
1657 and the time will be used in a condition as specified with
1658 \fICURLOPT_TIMECONDITION\fP.
1659 .SH CONNECTION OPTIONS
1660 .IP CURLOPT_TIMEOUT
1661 Pass a long as parameter containing the maximum time in seconds that you allow
1662 the libcurl transfer operation to take. Normally, name lookups can take a
1663 considerable time and limiting operations to less than a few minutes risk
1664 aborting perfectly normal operations. This option will cause curl to use the
1665 SIGALRM to enable time-outing system calls.
1666
1667 In unix-like systems, this might cause signals to be used unless
1668 \fICURLOPT_NOSIGNAL\fP is set.
1669 .IP CURLOPT_TIMEOUT_MS
1670 Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If
1671 libcurl is built to use the standard system name resolver, that portion
1672 of the transfer will still use full-second resolution for timeouts with
1673 a minimum timeout allowed of one second.
1674 (Added in 7.16.2)
1675 .IP CURLOPT_LOW_SPEED_LIMIT
1676 Pass a long as parameter. It contains the transfer speed in bytes per second
1677 that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
1678 for the library to consider it too slow and abort.
1679 .IP CURLOPT_LOW_SPEED_TIME
1680 Pass a long as parameter. It contains the time in seconds that the transfer
1681 should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
1682 it too slow and abort.
1683 .IP CURLOPT_MAX_SEND_SPEED_LARGE
1684 Pass a curl_off_t as parameter.  If an upload exceeds this speed (counted in
1685 bytes per second) on cumulative average during the transfer, the transfer will
1686 pause to keep the average rate less than or equal to the parameter value.
1687 Defaults to unlimited speed. (Added in 7.15.5)
1688 .IP CURLOPT_MAX_RECV_SPEED_LARGE
1689 Pass a curl_off_t as parameter.  If a download exceeds this speed (counted in
1690 bytes per second) on cumulative average during the transfer, the transfer will
1691 pause to keep the average rate less than or equal to the parameter
1692 value. Defaults to unlimited speed. (Added in 7.15.5)
1693 .IP CURLOPT_MAXCONNECTS
1694 Pass a long. The set number will be the persistent connection cache size. The
1695 set amount will be the maximum amount of simultaneously open connections that
1696 libcurl may cache in this easy handle. Default is 5, and there isn't much
1697 point in changing this value unless you are perfectly aware of how this works
1698 and changes libcurl's behaviour. This concerns connections using any of the
1699 protocols that support persistent connections.
1700
1701 When reaching the maximum limit, curl closes the oldest one in the cache to
1702 prevent increasing the number of open connections.
1703
1704 If you already have performed transfers with this curl handle, setting a
1705 smaller MAXCONNECTS than before may cause open connections to get closed
1706 unnecessarily.
1707
1708 If you add this easy handle to a multi handle, this setting is not
1709 acknowledged, and you must instead use \fIcurl_multi_setopt(3)\fP and the
1710 \fICURLMOPT_MAXCONNECTS\fP option.
1711 .IP CURLOPT_CLOSEPOLICY
1712 (Obsolete) This option does nothing.
1713 .IP CURLOPT_FRESH_CONNECT
1714 Pass a long. Set to 1 to make the next transfer use a new (fresh) connection
1715 by force. If the connection cache is full before this connection, one of the
1716 existing connections will be closed as according to the selected or default
1717 policy. This option should be used with caution and only if you understand
1718 what it does. Set this to 0 to have libcurl attempt re-using an existing
1719 connection (default behavior).
1720 .IP CURLOPT_FORBID_REUSE
1721 Pass a long. Set to 1 to make the next transfer explicitly close the
1722 connection when done. Normally, libcurl keeps all connections alive when done
1723 with one transfer in case a succeeding one follows that can re-use them.
1724 This option should be used with caution and only if you understand what it
1725 does. Set to 0 to have libcurl keep the connection open for possible later
1726 re-use (default behavior).
1727 .IP CURLOPT_CONNECTTIMEOUT
1728 Pass a long. It should contain the maximum time in seconds that you allow the
1729 connection to the server to take.  This only limits the connection phase, once
1730 it has connected, this option is of no more use. Set to zero to disable
1731 connection timeout (it will then only timeout on the system's internal
1732 timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
1733
1734 In unix-like systems, this might cause signals to be used unless
1735 \fICURLOPT_NOSIGNAL\fP is set.
1736 .IP CURLOPT_CONNECTTIMEOUT_MS
1737 Like \fICURLOPT_CONNECTTIMEOUT\fP but takes the number of milliseconds
1738 instead. If libcurl is built to use the standard system name resolver,
1739 that portion of the connect will still use full-second resolution for
1740 timeouts with a minimum timeout allowed of one second.
1741 (Added in 7.16.2)
1742 .IP CURLOPT_IPRESOLVE
1743 Allows an application to select what kind of IP addresses to use when
1744 resolving host names. This is only interesting when using host names that
1745 resolve addresses using more than one version of IP. The allowed values are:
1746 .RS
1747 .IP CURL_IPRESOLVE_WHATEVER
1748 Default, resolves addresses to all IP versions that your system allows.
1749 .IP CURL_IPRESOLVE_V4
1750 Resolve to IPv4 addresses.
1751 .IP CURL_IPRESOLVE_V6
1752 Resolve to IPv6 addresses.
1753 .RE
1754 .IP CURLOPT_CONNECT_ONLY
1755 Pass a long. If the parameter equals 1, it tells the library to perform all
1756 the required proxy authentication and connection setup, but no data transfer.
1757 This option is useful only on HTTP URLs.
1758
1759 This option is useful with the \fICURLINFO_LASTSOCKET\fP option to
1760 \fIcurl_easy_getinfo(3)\fP. The library can set up the connection and then the
1761 application can obtain the most recently used socket for special data
1762 transfers. (Added in 7.15.2)
1763 .IP CURLOPT_USE_SSL
1764 Pass a long using one of the values from below, to make libcurl use your
1765 desired level of SSL for the transfer. (Added in 7.11.0)
1766
1767 This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc.
1768
1769 (This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
1770 were known as CURLFTPSSL_*)
1771 .RS
1772 .IP CURLUSESSL_NONE
1773 Don't attempt to use SSL.
1774 .IP CURLUSESSL_TRY
1775 Try using SSL, proceed as normal otherwise.
1776 .IP CURLUSESSL_CONTROL
1777 Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP.
1778 .IP CURLUSESSL_ALL
1779 Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
1780 .RE
1781 .IP CURLOPT_RESOLVE
1782 Pass a pointer to a linked list of strings with host name resolve information
1783 to use for requests with this handle. The linked list should be a fully valid
1784 list of \fBstruct curl_slist\fP structs properly filled in. Use
1785 \fIcurl_slist_append(3)\fP to create the list and \fIcurl_slist_free_all(3)\fP
1786 to clean up an entire list.
1787
1788 Each single name resolve string should be written using the format
1789 HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve, PORT is
1790 the port number of the service where libcurl wants to connect to the HOST and
1791 ADDRESS is the numerical IP address. If libcurl is built to support IPv6,
1792 ADDRESS can of course be either IPv4 or IPv6 style addressing.
1793
1794 This option effectively pre-populates the DNS cache with entries for the
1795 host+port pair so redirects and everything that operations against the
1796 HOST+PORT will instead use your provided ADDRESS.
1797
1798 You can remove names from the DNS cache again, to stop providing these fake
1799 resolves, by including a string in the linked list that uses the format
1800 \&"-HOST:PORT". The host name must be prefixed with a dash, and the host name
1801 and port number must exactly match what was already added previously.
1802
1803 (Added in 7.12.3)
1804 .SH SSL and SECURITY OPTIONS
1805 .IP CURLOPT_SSLCERT
1806 Pass a pointer to a zero terminated string as parameter. The string should be
1807 the file name of your certificate. The default format is "PEM" and can be
1808 changed with \fICURLOPT_SSLCERTTYPE\fP.
1809
1810 With NSS this is the nickname of the certificate you wish to authenticate
1811 with.
1812 .IP CURLOPT_SSLCERTTYPE
1813 Pass a pointer to a zero terminated string as parameter. The string should be
1814 the format of your certificate. Supported formats are "PEM" and "DER".  (Added
1815 in 7.9.3)
1816 .IP CURLOPT_SSLKEY
1817 Pass a pointer to a zero terminated string as parameter. The string should be
1818 the file name of your private key. The default format is "PEM" and can be
1819 changed with \fICURLOPT_SSLKEYTYPE\fP.
1820 .IP CURLOPT_SSLKEYTYPE
1821 Pass a pointer to a zero terminated string as parameter. The string should be
1822 the format of your private key. Supported formats are "PEM", "DER" and "ENG".
1823
1824 The format "ENG" enables you to load the private key from a crypto engine. In
1825 this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to the
1826 engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
1827 \&"DER" format key file currently does not work because of a bug in OpenSSL.
1828 .IP CURLOPT_KEYPASSWD
1829 Pass a pointer to a zero terminated string as parameter. It will be used as
1830 the password required to use the \fICURLOPT_SSLKEY\fP or
1831 \fICURLOPT_SSH_PRIVATE_KEYFILE\fP private key.
1832 You never needed a pass phrase to load a certificate but you need one to
1833 load your private key.
1834
1835 (This option was known as CURLOPT_SSLKEYPASSWD up to 7.16.4 and
1836 CURLOPT_SSLCERTPASSWD up to 7.9.2)
1837 .IP CURLOPT_SSLENGINE
1838 Pass a pointer to a zero terminated string as parameter. It will be used as
1839 the identifier for the crypto engine you want to use for your private
1840 key.
1841
1842 If the crypto device cannot be loaded, \fICURLE_SSL_ENGINE_NOTFOUND\fP is
1843 returned.
1844 .IP CURLOPT_SSLENGINE_DEFAULT
1845 Sets the actual crypto engine as the default for (asymmetric) crypto
1846 operations.
1847
1848 If the crypto device cannot be set, \fICURLE_SSL_ENGINE_SETFAILED\fP is
1849 returned.
1850
1851 Even though this option doesn't need any parameter, in some configurations
1852 \fIcurl_easy_setopt\fP might be defined as a macro taking exactly three
1853 arguments. Therefore, it's recommended to pass 1 as parameter to this option.
1854 .IP CURLOPT_SSLVERSION
1855 Pass a long as parameter to control what version of SSL/TLS to attempt to use.
1856 The available options are:
1857 .RS
1858 .IP CURL_SSLVERSION_DEFAULT
1859 The default action. This will attempt to figure out the remote SSL protocol
1860 version, i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled
1861 by default with 7.18.1).
1862 .IP CURL_SSLVERSION_TLSv1
1863 Force TLSv1
1864 .IP CURL_SSLVERSION_SSLv2
1865 Force SSLv2
1866 .IP CURL_SSLVERSION_SSLv3
1867 Force SSLv3
1868 .RE
1869 .IP CURLOPT_SSL_VERIFYPEER
1870 Pass a long as parameter.
1871
1872 This option determines whether curl verifies the authenticity of the peer's
1873 certificate. A value of 1 means curl verifies; zero means it doesn't.  The
1874 default is nonzero, but before 7.10, it was zero.
1875
1876 When negotiating an SSL connection, the server sends a certificate indicating
1877 its identity.  Curl verifies whether the certificate is authentic, i.e. that
1878 you can trust that the server is who the certificate says it is.  This trust
1879 is based on a chain of digital signatures, rooted in certification authority
1880 (CA) certificates you supply.  As of 7.10, curl installs a default bundle of
1881 CA certificates and you can specify alternate certificates with the
1882 \fICURLOPT_CAINFO\fP option or the \fICURLOPT_CAPATH\fP option.
1883
1884 When \fICURLOPT_SSL_VERIFYPEER\fP is nonzero, and the verification fails to
1885 prove that the certificate is authentic, the connection fails.  When the
1886 option is zero, the connection succeeds regardless.
1887
1888 Authenticating the certificate is not by itself very useful.  You typically
1889 want to ensure that the server, as authentically identified by its
1890 certificate, is the server you mean to be talking to.  Use
1891 \fICURLOPT_SSL_VERIFYHOST\fP to control that.
1892 .IP CURLOPT_CAINFO
1893 Pass a char * to a zero terminated string naming a file holding one or more
1894 certificates to verify the peer with.  This makes sense only when used in
1895 combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1896 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not
1897 even indicate an accessible file.
1898
1899 This option is by default set to the system path where libcurl's cacert bundle
1900 is assumed to be stored, as established at build time.
1901
1902 When built against NSS, this is the directory that the NSS certificate
1903 database resides in.
1904 .IP CURLOPT_ISSUERCERT
1905 Pass a char * to a zero terminated string naming a file holding a CA
1906 certificate in PEM format. If the option is set, an additional check against
1907 the peer certificate is performed to verify the issuer is indeed the one
1908 associated with the certificate provided by the option. This additional check
1909 is useful in multi-level PKI where one needs to enforce that the peer
1910 certificate is from a specific branch of the tree.
1911
1912 This option makes sense only when used in combination with the
1913 \fICURLOPT_SSL_VERIFYPEER\fP option. Otherwise, the result of the check is not
1914 considered as failure.
1915
1916 A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option,
1917 which is returned if the setup of the SSL/TLS session has failed due to a
1918 mismatch with the issuer of peer certificate (\fICURLOPT_SSL_VERIFYPEER\fP has
1919 to be set too for the check to fail). (Added in 7.19.0)
1920 .IP CURLOPT_CAPATH
1921 Pass a char * to a zero terminated string naming a directory holding multiple
1922 CA certificates to verify the peer with. The certificate directory must be
1923 prepared using the openssl c_rehash utility. This makes sense only when used
1924 in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1925 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAPATH\fP need not even
1926 indicate an accessible path.  The \fICURLOPT_CAPATH\fP function apparently
1927 does not work in Windows due to some limitation in openssl. This option is
1928 OpenSSL-specific and does nothing if libcurl is built to use GnuTLS.
1929 .IP CURLOPT_CRLFILE
1930 Pass a char * to a zero terminated string naming a file with the concatenation
1931 of CRL (in PEM format) to use in the certificate validation that occurs during
1932 the SSL exchange.
1933
1934 When curl is built to use NSS or GnuTLS, there is no way to influence the use
1935 of CRL passed to help in the verification process. When libcurl is built with
1936 OpenSSL support, X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both
1937 set, requiring CRL check against all the elements of the certificate chain if
1938 a CRL file is passed.
1939
1940 This option makes sense only when used in combination with the
1941 \fICURLOPT_SSL_VERIFYPEER\fP option.
1942
1943 A specific error code (CURLE_SSL_CRL_BADFILE) is defined with the option. It
1944 is returned when the SSL exchange fails because the CRL file cannot be loaded.
1945 A failure in certificate verification due to a revocation information found in
1946 the CRL does not trigger this specific error. (Added in 7.19.0)
1947 .IP CURLOPT_CERTINFO
1948 Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With
1949 this enabled, libcurl (if built with OpenSSL) will extract lots of information
1950 and data about the certificates in the certificate chain used in the SSL
1951 connection. This data is then possible to extract after a transfer using
1952 \fIcurl_easy_getinfo(3)\fP and its option \fICURLINFO_CERTINFO\fP. (Added in
1953 7.19.1)
1954 .IP CURLOPT_RANDOM_FILE
1955 Pass a char * to a zero terminated file name. The file will be used to read
1956 from to seed the random engine for SSL. The more random the specified file is,
1957 the more secure the SSL connection will become.
1958 .IP CURLOPT_EGDSOCKET
1959 Pass a char * to the zero terminated path name to the Entropy Gathering Daemon
1960 socket. It will be used to seed the random engine for SSL.
1961 .IP CURLOPT_SSL_VERIFYHOST
1962 Pass a long as parameter.
1963
1964 This option determines whether libcurl verifies that the server cert is for
1965 the server it is known as.
1966
1967 When negotiating a SSL connection, the server sends a certificate indicating
1968 its identity.
1969
1970 When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
1971 the server is the server to which you meant to connect, or the connection
1972 fails.
1973
1974 Curl considers the server the intended one when the Common Name field or a
1975 Subject Alternate Name field in the certificate matches the host name in the
1976 URL to which you told Curl to connect.
1977
1978 When the value is 1, the certificate must contain a Common Name field, but it
1979 doesn't matter what name it says.  (This is not ordinarily a useful setting).
1980
1981 When the value is 0, the connection succeeds regardless of the names in the
1982 certificate.
1983
1984 The default, since 7.10, is 2.
1985
1986 This option controls checking the server's claimed identity.  The server could
1987 be lying.  To control lying, see \fICURLOPT_SSL_VERIFYPEER\fP.
1988 .IP CURLOPT_SSL_CIPHER_LIST
1989 Pass a char *, pointing to a zero terminated string holding the list of
1990 ciphers to use for the SSL connection. The list must be syntactically correct,
1991 it consists of one or more cipher strings separated by colons. Commas or
1992 spaces are also acceptable separators but colons are normally used, \&!, \&-
1993 and \&+ can be used as operators.
1994
1995 For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
1996 \'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you
1997 compile OpenSSL.
1998
1999 You'll find more details about cipher lists on this URL:
2000 \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
2001
2002 For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5',
2003 \'rsa_aes_128_sha\', etc. With NSS you don't add/remove ciphers. If one uses
2004 this option then all known ciphers are disabled and only those passed in
2005 are enabled.
2006
2007 You'll find more details about the NSS cipher lists on this URL:
2008 \fIhttp://directory.fedora.redhat.com/docs/mod_nss.html#Directives\fP
2009
2010 .IP CURLOPT_SSL_SESSIONID_CACHE
2011 Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set
2012 this to 1 to enable it. By default all transfers are done using the
2013 cache. While nothing ever should get hurt by attempting to reuse SSL
2014 session-IDs, there seem to be broken SSL implementations in the wild that may
2015 require you to disable this in order for you to succeed. (Added in 7.16.0)
2016 .IP CURLOPT_KRBLEVEL
2017 Pass a char * as parameter. Set the kerberos security level for FTP; this also
2018 enables kerberos awareness.  This is a string, \&'clear', \&'safe',
2019 \&'confidential' or \&'private'.  If the string is set but doesn't match one
2020 of these, 'private' will be used. Set the string to NULL to disable kerberos
2021 support for FTP.
2022
2023 (This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)
2024 .SH SSH OPTIONS
2025 .IP CURLOPT_SSH_AUTH_TYPES
2026 Pass a long set to a bitmask consisting of one or more of
2027 CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST,
2028 CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one.
2029 (Added in 7.16.1)
2030 .IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
2031 Pass a char * pointing to a string containing 32 hexadecimal digits. The
2032 string should be the 128 bit MD5 checksum of the remote host's public key, and
2033 libcurl will reject the connection to the host unless the md5sums match. This
2034 option is only for SCP and SFTP transfers. (Added in 7.17.1)
2035 .IP CURLOPT_SSH_PUBLIC_KEYFILE
2036 Pass a char * pointing to a file name for your public key. If not used,
2037 libcurl defaults to using \fB~/.ssh/id_dsa.pub\fP.
2038 (Added in 7.16.1)
2039 .IP CURLOPT_SSH_PRIVATE_KEYFILE
2040 Pass a char * pointing to a file name for your private key. If not used,
2041 libcurl defaults to using \fB~/.ssh/id_dsa\fP.  If the file is
2042 password-protected, set the password with \fICURLOPT_KEYPASSWD\fP. (Added in
2043 7.16.1)
2044 .IP CURLOPT_SSH_KNOWNHOSTS
2045 Pass a pointer to a zero terminated string holding the file name of the
2046 known_host file to use.  The known_hosts file should use the OpenSSH file
2047 format as supported by libssh2. If this file is specified, libcurl will only
2048 accept connections with hosts that are known and present in that file, with a
2049 matching public key. Use \fICURLOPT_SSH_KEYFUNCTION\fP to alter the default
2050 behavior on host and key (mis)matching. (Added in 7.19.6)
2051 .IP CURLOPT_SSH_KEYFUNCTION
2052 Pass a pointer to a curl_sshkeycallback function. It gets called when the
2053 known_host matching has been done, to allow the application to act and decide
2054 for libcurl how to proceed. It gets passed the CURL handle, the key from the
2055 known_hosts file, the key from the remote site, info from libcurl on the
2056 matching status and a custom pointer (set with \fICURLOPT_SSH_KEYDATA\fP). It
2057 MUST return one of the following return codes to tell libcurl how to act:
2058 .RS
2059 .IP CURLKHSTAT_FINE_ADD_TO_FILE
2060 The host+key is accepted and libcurl will append it to the known_hosts file
2061 before continuing with the connection. This will also add the host+key combo
2062 to the known_host pool kept in memory if it wasn't already present there. The
2063 adding of data to the file is done by completely replacing the file with a new
2064 copy, so the permissions of the file must allow this.
2065 .IP CURLKHSTAT_FINE
2066 The host+key is accepted libcurl will continue with the connection. This will
2067 also add the host+key combo to the known_host pool kept in memory if it wasn't
2068 already present there.
2069 .IP CURLKHSTAT_REJECT
2070 The host+key is rejected. libcurl will deny the connection to continue and it
2071 will be closed.
2072 .IP CURLKHSTAT_DEFER
2073 The host+key is rejected, but the SSH connection is asked to be kept alive.
2074 This feature could be used when the app wants to somehow return back and act
2075 on the host+key situation and then retry without needing the overhead of
2076 setting it up from scratch again.
2077 .RE
2078  (Added in 7.19.6)
2079 .IP CURLOPT_SSH_KEYDATA
2080 Pass a void * as parameter. This pointer will be passed along verbatim to the
2081 callback set with \fICURLOPT_SSH_KEYFUNCTION\fP. (Added in 7.19.6)
2082 .SH OTHER OPTIONS
2083 .IP CURLOPT_PRIVATE
2084 Pass a void * as parameter, pointing to data that should be associated with
2085 this curl handle.  The pointer can subsequently be retrieved using
2086 \fIcurl_easy_getinfo(3)\fP with the CURLINFO_PRIVATE option. libcurl itself
2087 does nothing with this data. (Added in 7.10.3)
2088 .IP CURLOPT_SHARE
2089 Pass a share handle as a parameter. The share handle must have been created by
2090 a previous call to \fIcurl_share_init(3)\fP. Setting this option, will make
2091 this curl handle use the data from the shared handle instead of keeping the
2092 data to itself. This enables several curl handles to share data. If the curl
2093 handles are used simultaneously in multiple threads, you \fBMUST\fP use the
2094 locking methods in the share handle. See \fIcurl_share_setopt(3)\fP for
2095 details.
2096
2097 If you add a share that is set to share cookies, your easy handle will use
2098 that cookie cache and get the cookie engine enabled. If you unshare an object
2099 that was using cookies (or change to another object that doesn't share
2100 cookies), the easy handle will get its cookie engine disabled.
2101
2102 Data that the share object is not set to share will be dealt with the usual
2103 way, as if no share was used.
2104 .IP CURLOPT_NEW_FILE_PERMS
2105 Pass a long as a parameter, containing the value of the permissions that will
2106 be assigned to newly created files on the remote server.  The default value is
2107 \fI0644\fP, but any valid value can be used.  The only protocols that can use
2108 this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP. (Added in 7.16.4)
2109 .IP CURLOPT_NEW_DIRECTORY_PERMS
2110 Pass a long as a parameter, containing the value of the permissions that will
2111 be assigned to newly created directories on the remote server.  The default
2112 value is \fI0755\fP, but any valid value can be used.  The only protocols that
2113 can use this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP.
2114 (Added in 7.16.4)
2115 .SH TELNET OPTIONS
2116 .IP CURLOPT_TELNETOPTIONS
2117 Provide a pointer to a curl_slist with variables to pass to the telnet
2118 negotiations. The variables should be in the format <option=value>. libcurl
2119 supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET
2120 standard for details.
2121 .SH RETURN VALUE
2122 CURLE_OK (zero) means that the option was set properly, non-zero means an
2123 error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors(3)\fP
2124 man page for the full list with descriptions.
2125
2126 If you try to set an option that libcurl doesn't know about, perhaps because
2127 the library is too old to support it or the option was removed in a recent
2128 version, this function will return \fICURLE_FAILED_INIT\fP.
2129 .SH "SEE ALSO"
2130 .BR curl_easy_init "(3), " curl_easy_cleanup "(3), " curl_easy_reset "(3)"