~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to docs/libcurl/curl_easy_setopt.html

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-16 15:16:54 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20070516151654-x9nkigtr2j0i8d0v
Tags: upstream-7.16.2
ImportĀ upstreamĀ versionĀ 7.16.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
<p class="level1">If you're using libcurl as a win32 DLL, you MUST use a <a class="emphasis" href="#CURLOPTREADFUNCTION">CURLOPT_READFUNCTION</a> if you set this option. 
86
86
<p class="level1">This option is also known with the older name <span Class="emphasis">CURLOPT_INFILE</span>, the name <a class="emphasis" href="#CURLOPTREADDATA">CURLOPT_READDATA</a> was introduced in 7.9.7. 
87
87
<p class="level0"><a name="CURLOPTIOCTLFUNCTION"></a><span class="nroffip">CURLOPT_IOCTLFUNCTION</span> 
88
 
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_ioctl_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl when something special I/O-related needs to be done that the library can't do by itself. For now, rewinding the read data stream is the only action it can request. The rewinding of the read data stream may be necessary when doing a HTTP PUT or POST with a multi-pass authentication method.  (Opion added in 7.12.3) 
 
88
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_ioctl_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl when something special I/O-related needs to be done that the library can't do by itself. For now, rewinding the read data stream is the only action it can request. The rewinding of the read data stream may be necessary when doing a HTTP PUT or POST with a multi-pass authentication method.  (Option added in 7.12.3) 
89
89
<p class="level0"><a name="CURLOPTIOCTLDATA"></a><span class="nroffip">CURLOPT_IOCTLDATA</span> 
90
90
<p class="level1">Pass a pointer that will be untouched by libcurl and passed as the 3rd argument in the ioctl callback set with <a class="emphasis" href="#CURLOPTIOCTLFUNCTION">CURLOPT_IOCTLFUNCTION</a>.  (Option added in 7.12.3) 
 
91
<p class="level0"><a name="CURLOPTSOCKOPTFUNCTION"></a><span class="nroffip">CURLOPT_SOCKOPTFUNCTION</span> 
 
92
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_sockopt_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl after the socket() call but before the connect() call. The callback's <span Class="emphasis">purpose</span> argument identifies the exact purpose for this particular socket, and currently only one value is supported: <span Class="emphasis">CURLSOCKTYPE_IPCXN</span> for the primary connection (meaning the control connection in the FTP case). Future versions of libcurl may support more purposes. It passes the newly created socket descriptor so additional setsockopt() calls can be done at the user's discretion.  A non-zero return code from the callback function will signal an unrecoverable error to the library and it will close the socket and return <span Class="emphasis">CURLE_COULDNT_CONNECT</span>.  (Option added in 7.15.6.) 
 
93
<p class="level0"><a name="CURLOPTSOCKOPTDATA"></a><span class="nroffip">CURLOPT_SOCKOPTDATA</span> 
 
94
<p class="level1">Pass a pointer that will be untouched by libcurl and passed as the first argument in the sockopt callback set with <a class="emphasis" href="#CURLOPTSOCKOPTFUNCTION">CURLOPT_SOCKOPTFUNCTION</a>. (Option added in 7.15.6.) 
91
95
<p class="level0"><a name="CURLOPTPROGRESSFUNCTION"></a><span class="nroffip">CURLOPT_PROGRESSFUNCTION</span> 
92
96
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_progress_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl instead of its internal equivalent with a frequent interval during operation (roughly once per second) no matter if data is being transfered or not.  Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Returning a non-zero value from this callback will cause libcurl to abort the transfer and return <span Class="emphasis">CURLE_ABORTED_BY_CALLBACK</span>. 
93
97
<p class="level1">If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers. Usage of the <a class="bold" href="#CURLOPTPROGRESSFUNCTION">CURLOPT_PROGRESSFUNCTION</a> callback is not recommended when using the multi interface. 
148
152
<p class="level0"><a name="CURLOPTSTDERR"></a><span class="nroffip">CURLOPT_STDERR</span> 
149
153
<p class="level1">Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr when showing the progress meter and displaying <a class="emphasis" href="#CURLOPTVERBOSE">CURLOPT_VERBOSE</a> data. 
150
154
<p class="level0"><a name="CURLOPTFAILONERROR"></a><span class="nroffip">CURLOPT_FAILONERROR</span> 
151
 
<p class="level1">A non-zero parameter tells the library to fail silently if the HTTP code returned is equal to or larger than 400. The default action would be to return the page normally, ignoring that code. <a name="NETWORK"></a><h2 class="nroffsh">NETWORK OPTIONS</h2>
 
155
<p class="level1">A non-zero parameter tells the library to fail silently if the HTTP code returned is equal to or larger than 400. The default action would be to return the page normally, ignoring that code. 
 
156
<p class="level1">This method is not fail-safe and there are occasions where non-succesful response codes will slip through, especially when authentication is involved (response codes 401 and 407). 
 
157
<p class="level1">You might get some amounts of headers transferred before this situation is detected, like for when a "100-continue" is received as a response to a POST/PUT and a 401 or 407 is received immediately afterwards. <a name="NETWORK"></a><h2 class="nroffsh">NETWORK OPTIONS</h2>
152
158
<p class="level0">
153
159
<p class="level0"><a name="CURLOPTURL"></a><span class="nroffip">CURLOPT_URL</span> 
154
160
<p class="level1">The actual URL to deal with. The parameter should be a char * to a zero terminated string. The string must remain present until curl no longer needs it, as it doesn't copy the string. 
159
165
<p class="level1">Set HTTP proxy to use. The parameter should be a char * to a zero terminated string holding the host name or dotted IP address. To specify port number in this string, append :[port] to the end of the host name. The proxy string may be prefixed with [protocol]:// since any such prefix will be ignored. The proxy's port number may optionally be specified with the separate option <a class="emphasis" href="#CURLOPTPROXYPORT">CURLOPT_PROXYPORT</a>. 
160
166
<p class="level1">When you tell the library to use an HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a> and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with <a class="emphasis" href="#CURLOPTHTTPPROXYTUNNEL">CURLOPT_HTTPPROXYTUNNEL</a>. 
161
167
<p class="level1">libcurl respects the environment variables <span Class="bold">http_proxy</span>, <span Class="bold">ftp_proxy</span>, <span Class="bold">all_proxy</span> etc, if any of those is set. The <a class="emphasis" href="#CURLOPTPROXY">CURLOPT_PROXY</a> option does however override any possibly set environment variables. 
162
 
<p class="level1">Starting with 7.14.1, the proxy host string can be specified the exact same way as the proxy environment variables, include protocol prefix (http://) and embedded user + password. 
 
168
<p class="level1">Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it. 
 
169
<p class="level1">Since 7.14.1, the proxy host string given in environment variables can be specified the exact same way as the proxy can be set with <a class="emphasis" href="#CURLOPTPROXY">CURLOPT_PROXY</a>, include protocol prefix (http://) and embedded user + password. 
163
170
<p class="level0"><a name="CURLOPTPROXYPORT"></a><span class="nroffip">CURLOPT_PROXYPORT</span> 
164
171
<p class="level1">Pass a long with this option to set the proxy port to connect to unless it is specified in the proxy string <a class="emphasis" href="#CURLOPTPROXY">CURLOPT_PROXY</a>. 
165
172
<p class="level0"><a name="CURLOPTPROXYTYPE"></a><span class="nroffip">CURLOPT_PROXYTYPE</span> 
310
317
<p class="level2">Enforce HTTP 1.1 requests. 
311
318
<p class="level1"><a name="CURLOPTIGNORECONTENTLENGTH"></a><span class="nroffip">CURLOPT_IGNORE_CONTENT_LENGTH</span> 
312
319
<p class="level2">Ignore the Content-Length header. This is useful for Apache 1.x (and similar servers) which will report incorrect content length for files over 2 gigabytes. If this option is used, curl will not be able to accurately report progress, and will simply stop the download when the server ends the connection. (added in 7.14.1) 
 
320
<p class="level1"><a name="CURLOPTHTTPCONTENTDECODING"></a><span class="nroffip">CURLOPT_HTTP_CONTENT_DECODING</span> 
 
321
<p class="level2">Pass a long to tell libcurl how to act on content decoding. If set to zero, content decoding will be disabled. If set to 1 it is enabled. Note however that libcurl has no default content decoding but requires you to use <a class="emphasis" href="#CURLOPTENCODING">CURLOPT_ENCODING</a> for that. (added in 7.16.2) 
 
322
<p class="level1"><a name="CURLOPTHTTPTRANSFERDECODING"></a><span class="nroffip">CURLOPT_HTTP_TRANSFER_DECODING</span> 
 
323
<p class="level2">Pass a long to tell libcurl how to act on transfer decoding. If set to zero, transfer decoding will be disabled, if set to 1 it is enabled (default). libcurl does chunked transfer decoding by default unless this option is set to zero. (added in 7.16.2) 
313
324
<p class="level1"><a name="FTP"></a><h2 class="nroffsh">FTP OPTIONS</h2>
314
325
<p class="level0">
315
326
<p class="level0"><a name="CURLOPTFTPPORT"></a><span class="nroffip">CURLOPT_FTPPORT</span> 
320
331
<p class="level0"><a name="CURLOPTPOSTQUOTE"></a><span class="nroffip">CURLOPT_POSTQUOTE</span> 
321
332
<p class="level1">Pass a pointer to a linked list of FTP commands to pass to the server after your ftp transfer request. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a>. Disable this operation again by setting a NULL to this option. 
322
333
<p class="level0"><a name="CURLOPTPREQUOTE"></a><span class="nroffip">CURLOPT_PREQUOTE</span> 
323
 
<p class="level1">Pass a pointer to a linked list of FTP commands to pass to the server after the transfer type is set. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a>. Disable this operation again by setting a NULL to this option. 
 
334
<p class="level1">Pass a pointer to a linked list of FTP commands to pass to the server after the transfer type is set. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a>. Disable this operation again by setting a NULL to this option. Before version 7.15.6, if you also set <a class="emphasis" href="#CURLOPTNOBODY">CURLOPT_NOBODY</a> non-zero, this option didn't work. 
324
335
<p class="level0"><a name="CURLOPTFTPLISTONLY"></a><span class="nroffip">CURLOPT_FTPLISTONLY</span> 
325
336
<p class="level1">A non-zero parameter tells the library to just list the names of an ftp directory, instead of doing a full directory listing that would include file sizes, dates etc. 
326
337
<p class="level1">This causes an FTP NLST command to be sent.  Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links. 
363
374
<p class="level1"><a name="CURLFTPAUTHTLS"></a><span class="nroffip">CURLFTPAUTH_TLS</span> 
364
375
<p class="level2">Try "AUTH TLS" first, and only if that fails try "AUTH SSL" 
365
376
<p class="level1">
366
 
<p class="level0"><a name="CURLOPTSOURCEURL"></a><span class="nroffip">CURLOPT_SOURCE_URL</span> 
367
 
<p class="level1">When set, it enables a FTP third party transfer, using the set URL as source, while <a class="emphasis" href="#CURLOPTURL">CURLOPT_URL</a> is the target. 
368
 
<p class="level0"><a name="CURLOPTSOURCEUSERPWD"></a><span class="nroffip">CURLOPT_SOURCE_USERPWD</span> 
369
 
<p class="level1">Set "username:password" to use for the source connection when doing FTP third party transfers. 
370
 
<p class="level0"><a name="CURLOPTSOURCEQUOTE"></a><span class="nroffip">CURLOPT_SOURCE_QUOTE</span> 
371
 
<p class="level1">Exactly like <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a>, but for the source host. 
372
 
<p class="level0"><a name="CURLOPTSOURCEPREQUOTE"></a><span class="nroffip">CURLOPT_SOURCE_PREQUOTE</span> 
373
 
<p class="level1">Exactly like <a class="emphasis" href="#CURLOPTPREQUOTE">CURLOPT_PREQUOTE</a>, but for the source host. 
374
 
<p class="level0"><a name="CURLOPTSOURCEPOSTQUOTE"></a><span class="nroffip">CURLOPT_SOURCE_POSTQUOTE</span> 
375
 
<p class="level1">Exactly like <a class="emphasis" href="#CURLOPTPOSTQUOTE">CURLOPT_POSTQUOTE</a>, but for the source host. 
 
377
<p class="level0"><a name="CURLOPTFTPSSLCCC"></a><span class="nroffip">CURLOPT_FTP_SSL_CCC</span> 
 
378
<p class="level1">If enabled, this option makes libcurl use CCC (Clear Command Channel). It shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. Pass a long using one of the values below. (Added in 7.16.1) 
 
379
<p class="level2">
 
380
<p class="level1"><a name="CURLFTPSSLCCCNONE"></a><span class="nroffip">CURLFTPSSL_CCC_NONE</span> 
 
381
<p class="level2">Don't attempt to use CCC. 
 
382
<p class="level1"><a name="CURLFTPSSLCCCPASSIVE"></a><span class="nroffip">CURLFTPSSL_CCC_PASSIVE</span> 
 
383
<p class="level2">Do not initiate the shutdown, but wait for the server to do it. Do not send a reply. 
 
384
<p class="level1"><a name="CURLFTPSSLCCCACTIVE"></a><span class="nroffip">CURLFTPSSL_CCC_ACTIVE</span> 
 
385
<p class="level2">Initiate the shutdown and wait for a reply. 
 
386
<p class="level1">
376
387
<p class="level0"><a name="CURLOPTFTPACCOUNT"></a><span class="nroffip">CURLOPT_FTP_ACCOUNT</span> 
377
388
<p class="level1">Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command. (Added in 7.13.0) 
378
389
<p class="level0"><a name="CURLOPTFTPFILEMETHOD"></a><span class="nroffip">CURLOPT_FTP_FILEMETHOD</span> 
394
405
<p class="level0"><a name="CURLOPTRANGE"></a><span class="nroffip">CURLOPT_RANGE</span> 
395
406
<p class="level1">Pass a char * as parameter, which should contain the specified range you want. It should be in the format "X-Y", where X or Y may be left out. HTTP transfers also support several intervals, separated with commas as in <span Class="emphasis">"X-Y,N-M"</span>. Using this kind of multiple intervals will cause the HTTP server to send the response document in pieces (using standard MIME separation techniques). Pass a NULL to this option to disable the use of ranges. 
396
407
<p class="level0"><a name="CURLOPTRESUMEFROM"></a><span class="nroffip">CURLOPT_RESUME_FROM</span> 
397
 
<p class="level1">Pass a long as parameter. It contains the offset in number of bytes that you want the transfer to start from. Set this option to 0 to make the transfer start from the beginning (effectively disabling resume). 
 
408
<p class="level1">Pass a long as parameter. It contains the offset in number of bytes that you want the transfer to start from. Set this option to 0 to make the transfer start from the beginning (effectively disabling resume). For FTP, set this option to -1 to make the transfer start from the end of the target file (useful to continue an interrupted upload). 
398
409
<p class="level0"><a name="CURLOPTRESUMEFROMLARGE"></a><span class="nroffip">CURLOPT_RESUME_FROM_LARGE</span> 
399
410
<p class="level1">Pass a curl_off_t as parameter. It contains the offset in number of bytes that you want the transfer to start from. (Added in 7.11.0) 
400
411
<p class="level0"><a name="CURLOPTCUSTOMREQUEST"></a><span class="nroffip">CURLOPT_CUSTOMREQUEST</span> 
408
419
<p class="level1">To change request to GET, you should use <a class="emphasis" href="#CURLOPTHTTPGET">CURLOPT_HTTPGET</a>. Change request to POST with <a class="emphasis" href="#CURLOPTPOST">CURLOPT_POST</a> etc. 
409
420
<p class="level0"><a name="CURLOPTINFILESIZE"></a><span class="nroffip">CURLOPT_INFILESIZE</span> 
410
421
<p class="level1">When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. This value should be passed as a long. See also <a class="emphasis" href="#CURLOPTINFILESIZELARGE">CURLOPT_INFILESIZE_LARGE</a>. 
 
422
<p class="level1">Note that this option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns. 
411
423
<p class="level0"><a name="CURLOPTINFILESIZELARGE"></a><span class="nroffip">CURLOPT_INFILESIZE_LARGE</span> 
412
424
<p class="level1">When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is.  This value should be passed as a curl_off_t. (Added in 7.11.0) 
 
425
<p class="level1">Note that this option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns. 
413
426
<p class="level0"><a name="CURLOPTUPLOAD"></a><span class="nroffip">CURLOPT_UPLOAD</span> 
414
 
<p class="level1">A non-zero parameter tells the library to prepare for an upload. The <a class="emphasis" href="#CURLOPTREADDATA">CURLOPT_READDATA</a> and <span Class="emphasis">CURLOPT_INFILESIZEE</span> or <a class="emphasis" href="#CURLOPTINFILESIZELARGE">CURLOPT_INFILESIZE_LARGE</a> are also interesting for uploads. If the protocol is HTTP, uploading means using the PUT request unless you tell libcurl otherwise. 
 
427
<p class="level1">A non-zero parameter tells the library to prepare for an upload. The <a class="emphasis" href="#CURLOPTREADDATA">CURLOPT_READDATA</a> and <a class="emphasis" href="#CURLOPTINFILESIZE">CURLOPT_INFILESIZE</a> or <a class="emphasis" href="#CURLOPTINFILESIZELARGE">CURLOPT_INFILESIZE_LARGE</a> options are also interesting for uploads. If the protocol is HTTP, uploading means using the PUT request unless you tell libcurl otherwise. 
415
428
<p class="level1">Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with <a class="emphasis" href="#CURLOPTHTTPHEADER">CURLOPT_HTTPHEADER</a> as usual. 
416
429
<p class="level1">If you use PUT to a HTTP 1.1 server, you can upload data without knowing the size before starting the transfer if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with <a class="emphasis" href="#CURLOPTHTTPHEADER">CURLOPT_HTTPHEADER</a>. With HTTP 1.0 or without chunked transfer, you must specify the size. 
417
430
<p class="level0"><a name="CURLOPTMAXFILESIZE"></a><span class="nroffip">CURLOPT_MAXFILESIZE</span> 
429
442
<p class="level0"><a name="CURLOPTTIMEOUT"></a><span class="nroffip">CURLOPT_TIMEOUT</span> 
430
443
<p class="level1">Pass a long as parameter containing the maximum time in seconds that you allow the libcurl transfer operation to take. Normally, name lookups can take a considerable time and limiting operations to less than a few minutes risk aborting perfectly normal operations. This option will cause curl to use the SIGALRM to enable time-outing system calls. 
431
444
<p class="level1">In unix-like systems, this might cause signals to be used unless <a class="emphasis" href="#CURLOPTNOSIGNAL">CURLOPT_NOSIGNAL</a> is set. 
 
445
<p class="level0"><a name="CURLOPTTIMEOUTMS"></a><span class="nroffip">CURLOPT_TIMEOUT_MS</span> 
 
446
<p class="level1">Like <a class="emphasis" href="#CURLOPTTIMEOUT">CURLOPT_TIMEOUT</a> but takes number of milliseconds instead. If libcurl is built to use the standard system name resolver, that part will still use full-second resolution for timeouts. (Added in 7.16.2) 
432
447
<p class="level0"><a name="CURLOPTLOWSPEEDLIMIT"></a><span class="nroffip">CURLOPT_LOW_SPEED_LIMIT</span> 
433
448
<p class="level1">Pass a long as parameter. It contains the transfer speed in bytes per second that the transfer should be below during <a class="emphasis" href="#CURLOPTLOWSPEEDTIME">CURLOPT_LOW_SPEED_TIME</a> seconds for the library to consider it too slow and abort. 
434
449
<p class="level0"><a name="CURLOPTLOWSPEEDTIME"></a><span class="nroffip">CURLOPT_LOW_SPEED_TIME</span> 
435
450
<p class="level1">Pass a long as parameter. It contains the time in seconds that the transfer should be below the <a class="emphasis" href="#CURLOPTLOWSPEEDLIMIT">CURLOPT_LOW_SPEED_LIMIT</a> for the library to consider it too slow and abort. 
436
451
<p class="level0"><a name="CURLOPTMAXSENDSPEEDLARGE"></a><span class="nroffip">CURLOPT_MAX_SEND_SPEED_LARGE</span> 
437
 
<p class="level1">Pass a curl_off_t as parameter.  If an upload exceeds this speed on cumulative  average during the transfer, the transfer will pause to keep the average rate  less than or equal to the parameter value.  (default: 0, unlimited) 
 
452
<p class="level1">Pass a curl_off_t as parameter.  If an upload exceeds this speed on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value.  Defaults to unlimited speed. (Added in 7.15.5) 
438
453
<p class="level0"><a name="CURLOPTMAXRECVSPEEDLARGE"></a><span class="nroffip">CURLOPT_MAX_RECV_SPEED_LARGE</span> 
439
 
<p class="level1">Pass a curl_off_t as parameter.  If an upload exceeds this speed on cumulative  average during the transfer, the transfer will pause to keep the average rate  less than or equal to the parameter value.  (default: 0, unlimited) 
 
454
<p class="level1">Pass a curl_off_t as parameter.  If a download exceeds this speed on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed. (Added in 7.15.5) 
440
455
<p class="level0"><a name="CURLOPTMAXCONNECTS"></a><span class="nroffip">CURLOPT_MAXCONNECTS</span> 
441
456
<p class="level1">Pass a long. The set number will be the persistent connection cache size. The set amount will be the maximum amount of simultaneously open connections that libcurl may cache. Default is 5, and there isn't much point in changing this value unless you are perfectly aware of how this work and changes libcurl's behaviour. This concerns connection using any of the protocols that support persistent connections. 
442
 
<p class="level1">When reaching the maximum limit, curl uses the <a class="emphasis" href="#CURLOPTCLOSEPOLICY">CURLOPT_CLOSEPOLICY</a> to figure out which of the existing connections to close to prevent the number of open connections to increase. 
 
457
<p class="level1">When reaching the maximum limit, curl closes the oldest one in the cache to prevent the number of open connections to increase. 
443
458
<p class="level1">If you already have performed transfers with this curl handle, setting a smaller MAXCONNECTS than before may cause open connections to get closed unnecessarily. 
444
459
<p class="level0"><a name="CURLOPTCLOSEPOLICY"></a><span class="nroffip">CURLOPT_CLOSEPOLICY</span> 
445
 
<p class="level1">Pass a long. This option sets what policy libcurl should use when the connection cache is filled and one of the open connections has to be closed to make room for a new connection. This must be one of the CURLCLOSEPOLICY_* defines. Use <span Class="emphasis">CURLCLOSEPOLICY_LEAST_RECENTLY_USED</span> to make libcurl close the connection that was least recently used, that connection is also least likely to be capable of re-use. Use <span Class="emphasis">CURLCLOSEPOLICY_OLDEST</span> to make libcurl close the oldest connection, the one that was created first among the ones in the connection cache. The other close policies are not support yet. 
 
460
<p class="level1">(Obsolete) This option does nothing. 
446
461
<p class="level0"><a name="CURLOPTFRESHCONNECT"></a><span class="nroffip">CURLOPT_FRESH_CONNECT</span> 
447
462
<p class="level1">Pass a long. Set to non-zero to make the next transfer use a new (fresh) connection by force. If the connection cache is full before this connection, one of the existing connections will be closed as according to the selected or default policy. This option should be used with caution and only if you understand what it does. Set this to 0 to have libcurl attempt re-using an existing connection (default behavior). 
448
463
<p class="level0"><a name="CURLOPTFORBIDREUSE"></a><span class="nroffip">CURLOPT_FORBID_REUSE</span> 
450
465
<p class="level0"><a name="CURLOPTCONNECTTIMEOUT"></a><span class="nroffip">CURLOPT_CONNECTTIMEOUT</span> 
451
466
<p class="level1">Pass a long. It should contain the maximum time in seconds that you allow the connection to the server to take.  This only limits the connection phase, once it has connected, this option is of no more use. Set to zero to disable connection timeout (it will then only timeout on the system's internal timeouts). See also the <a class="emphasis" href="#CURLOPTTIMEOUT">CURLOPT_TIMEOUT</a> option. 
452
467
<p class="level1">In unix-like systems, this might cause signals to be used unless <a class="emphasis" href="#CURLOPTNOSIGNAL">CURLOPT_NOSIGNAL</a> is set. 
 
468
<p class="level0"><a name="CURLOPTCONNECTTIMEOUTMS"></a><span class="nroffip">CURLOPT_CONNECTTIMEOUT_MS</span> 
 
469
<p class="level1">Like <a class="emphasis" href="#CURLOPTCONNECTTIMEOUT">CURLOPT_CONNECTTIMEOUT</a> but takes number of milliseconds instead. If libcurl is built to use the standard system name resolver, that part will still use full-second resolution for timeouts. (Added in 7.16.2) 
453
470
<p class="level0"><a name="CURLOPTIPRESOLVE"></a><span class="nroffip">CURLOPT_IPRESOLVE</span> 
454
471
<p class="level1">Allows an application to select what kind of IP addresses to use when resolving host names. This is only interesting when using host names that resolve addresses using more than one version of IP. The allowed values are: 
455
472
<p class="level2">
466
483
<p class="level0">
467
484
<p class="level0"><a name="CURLOPTSSLCERT"></a><span class="nroffip">CURLOPT_SSLCERT</span> 
468
485
<p class="level1">Pass a pointer to a zero terminated string as parameter. The string should be the file name of your certificate. The default format is "PEM" and can be changed with <a class="emphasis" href="#CURLOPTSSLCERTTYPE">CURLOPT_SSLCERTTYPE</a>. 
 
486
<p class="level1">With NSS this is the nickname of the certificate you wish to authenticate with. 
469
487
<p class="level0"><a name="CURLOPTSSLCERTTYPE"></a><span class="nroffip">CURLOPT_SSLCERTTYPE</span> 
470
488
<p class="level1">Pass a pointer to a zero terminated string as parameter. The string should be the format of your certificate. Supported formats are "PEM" and "DER".  (Added in 7.9.3) 
471
489
<p class="level0"><a name="CURLOPTSSLCERTPASSWD"></a><span class="nroffip">CURLOPT_SSLCERTPASSWD</span> 
477
495
<p class="level1">Pass a pointer to a zero terminated string as parameter. The string should be the format of your private key. Supported formats are "PEM", "DER" and "ENG". 
478
496
<p class="level1">The format "ENG" enables you to load the private key from a crypto engine. In this case <a class="emphasis" href="#CURLOPTSSLKEY">CURLOPT_SSLKEY</a> is used as an identifier passed to the engine. You have to set the crypto engine with <a class="emphasis" href="#CURLOPTSSLENGINE">CURLOPT_SSLENGINE</a>. "DER" format key file currently does not work because of a bug in OpenSSL. 
479
497
<p class="level0"><a name="CURLOPTSSLKEYPASSWD"></a><span class="nroffip">CURLOPT_SSLKEYPASSWD</span> 
480
 
<p class="level1">Pass a pointer to a zero terminated string as parameter. It will be used as the password required to use the <a class="emphasis" href="#CURLOPTSSLKEY">CURLOPT_SSLKEY</a> private key. 
 
498
<p class="level1">Pass a pointer to a zero terminated string as parameter. It will be used as the password required to use the <a class="emphasis" href="#CURLOPTSSLKEY">CURLOPT_SSLKEY</a> or <a class="emphasis" href="#CURLOPTSSHPRIVATEKEYFILE">CURLOPT_SSH_PRIVATE_KEYFILE</a> private key. 
481
499
<p class="level0"><a name="CURLOPTSSLENGINE"></a><span class="nroffip">CURLOPT_SSLENGINE</span> 
482
500
<p class="level1">Pass a pointer to a zero terminated string as parameter. It will be used as the identifier for the crypto engine you want to use for your private key. 
483
501
<p class="level1">If the crypto device cannot be loaded, <span Class="emphasis">CURLE_SSL_ENGINE_NOTFOUND</span> is returned. 
488
506
<p class="level1">Pass a long as parameter to control what version of SSL/TLS to attempt to use. The available options are: 
489
507
<p class="level2">
490
508
<p class="level1"><a name="CURLSSLVERSIONDEFAULT"></a><span class="nroffip">CURL_SSLVERSION_DEFAULT</span> 
491
 
<p class="level2">The default action. When libcurl built with OpenSSL, this will attempt to figure out the remote SSL protocol version. Unfortunately there are a lot of ancient and broken servers in use which cannot handle this technique and will fail to connect. When libcurl is built with GnuTLS, this will mean SSLv3. 
 
509
<p class="level2">The default action. When libcurl built with OpenSSL or NSS, this will attempt to figure out the remote SSL protocol version. Unfortunately there are a lot of ancient and broken servers in use which cannot handle this technique and will fail to connect. When libcurl is built with GnuTLS, this will mean SSLv3. 
492
510
<p class="level1"><a name="CURLSSLVERSIONTLSv1"></a><span class="nroffip">CURL_SSLVERSION_TLSv1</span> 
493
511
<p class="level2">Force TLSv1 
494
512
<p class="level1"><a name="CURLSSLVERSIONSSLv2"></a><span class="nroffip">CURL_SSLVERSION_SSLv2</span> 
505
523
<p class="level0"><a name="CURLOPTCAINFO"></a><span class="nroffip">CURLOPT_CAINFO</span> 
506
524
<p class="level1">Pass a char * to a zero terminated string naming a file holding one or more certificates to verify the peer with.  This makes sense only when used in combination with the <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> option.  If <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> is zero, <a class="emphasis" href="#CURLOPTCAINFO">CURLOPT_CAINFO</a> need not even indicate an accessible file. 
507
525
<p class="level1">Note that option is by default set to the system path where libcurl's cacert bundle is assumed to be stored, as established at build time. 
 
526
<p class="level1">When built against NSS this is the directory that the NSS certificate database resides in. 
508
527
<p class="level0"><a name="CURLOPTCAPATH"></a><span class="nroffip">CURLOPT_CAPATH</span> 
509
 
<p class="level1">Pass a char * to a zero terminated string naming a directory holding multiple CA certificates to verify the peer with. The certificate directory must be prepared using the openssl c_rehash utility. This makes sense only when used in combination with the <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> option.  If <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> is zero, <a class="emphasis" href="#CURLOPTCAPATH">CURLOPT_CAPATH</a> need not even indicate an accessible path.  The <a class="emphasis" href="#CURLOPTCAPATH">CURLOPT_CAPATH</a> function apparently does not work in Windows due to some limitation in openssl. (Added in 7.9.8) 
 
528
<p class="level1">Pass a char * to a zero terminated string naming a directory holding multiple CA certificates to verify the peer with. The certificate directory must be prepared using the openssl c_rehash utility. This makes sense only when used in combination with the <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> option.  If <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> is zero, <a class="emphasis" href="#CURLOPTCAPATH">CURLOPT_CAPATH</a> need not even indicate an accessible path.  The <a class="emphasis" href="#CURLOPTCAPATH">CURLOPT_CAPATH</a> function apparently does not work in Windows due to some limitation in openssl. This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS. 
510
529
<p class="level0"><a name="CURLOPTRANDOMFILE"></a><span class="nroffip">CURLOPT_RANDOM_FILE</span> 
511
530
<p class="level1">Pass a char * to a zero terminated file name. The file will be used to read from to seed the random engine for SSL. The more random the specified file is, the more secure the SSL connection will become. 
512
531
<p class="level0"><a name="CURLOPTEGDSOCKET"></a><span class="nroffip">CURLOPT_EGDSOCKET</span> 
522
541
<p class="level1">The default, since 7.10, is 2. 
523
542
<p class="level1">The checking this option controls is of the identity that the server <span Class="emphasis">claims</span>.  The server could be lying.  To control lying, see <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a>. 
524
543
<p class="level0"><a name="CURLOPTSSLCIPHERLIST"></a><span class="nroffip">CURLOPT_SSL_CIPHER_LIST</span> 
525
 
<p class="level1">Pass a char *, pointing to a zero terminated string holding the list of ciphers to use for the SSL connection. The list must be syntactically correct, it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used, !, - and + can be used as operators. Valid examples of cipher lists include 'RC4-SHA', &acute;SHA1+DES&acute;, 'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL. 
 
544
<p class="level1">Pass a char *, pointing to a zero terminated string holding the list of ciphers to use for the SSL connection. The list must be syntactically correct, it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used, !, - and + can be used as operators. 
 
545
<p class="level1">For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', &acute;SHA1+DES&acute;, 'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL. 
526
546
<p class="level1">You'll find more details about cipher lists on this URL: <span Class="emphasis"><a href="http://www.openssl.org/docs/apps/ciphers.html">http://www.openssl.org/docs/apps/ciphers.html</a></span> 
 
547
<p class="level1">For NSS valid examples of cipher lists include 'rsa_rc4_128_md5', &acute;rsa_aes_128_sha&acute;, etc. With NSS you don't add/remove ciphers. If one uses this option then all known ciphers are disabled and only those passed in are enabled. 
 
548
<p class="level1">You'll find more details about the NSS cipher lists on this URL: <span Class="emphasis"><a href="http://directory.fedora.redhat.com/docs/mod_nss.html">http://directory.fedora.redhat.com/docs/mod_nss.html</a>#Directives</span> 
 
549
<p class="level1">
 
550
<p class="level0"><a name="CURLOPTSSLSESSIONIDCACHE"></a><span class="nroffip">CURLOPT_SSL_SESSIONID_CACHE</span> 
 
551
<p class="level1">Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set this to 1 to enable it. By default all transfers are done using the cache. Note that while nothing ever should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. (Added in 7.16.0) 
527
552
<p class="level0"><a name="CURLOPTKRB4LEVEL"></a><span class="nroffip">CURLOPT_KRB4LEVEL</span> 
528
 
<p class="level1">Pass a char * as parameter. Set the krb4 security level, this also enables krb4 awareness.  This is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string is set but doesn't match one of these, 'private' will be used. Set the string to NULL to disable kerberos4. The kerberos support only works for FTP. <a name="OTHER"></a><h2 class="nroffsh">OTHER OPTIONS</h2>
 
553
<p class="level1">Pass a char * as parameter. Set the krb4 security level, this also enables krb4 awareness.  This is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string is set but doesn't match one of these, 'private' will be used. Set the string to NULL to disable kerberos4. The kerberos support only works for FTP. <a name="SSH"></a><h2 class="nroffsh">SSH OPTIONS</h2>
 
554
<p class="level0">
 
555
<p class="level0"><a name="CURLOPTSSHAUTHTYPES"></a><span class="nroffip">CURLOPT_SSH_AUTH_TYPES</span> 
 
556
<p class="level1">Pass a long set to a bitmask consisting of one or more of CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one. 
 
557
<p class="level0"><a name="CURLOPTSSHPUBLICKEYFILE"></a><span class="nroffip">CURLOPT_SSH_PUBLIC_KEYFILE</span> 
 
558
<p class="level1">Pass a char * pointing to a file name for your public key. If not used, libcurl defaults to using <span Class="bold">~/.ssh/id_dsa.pub</span>. 
 
559
<p class="level0"><a name="CURLOPTSSHPRIVATEKEYFILE"></a><span class="nroffip">CURLOPT_SSH_PRIVATE_KEYFILE</span> 
 
560
<p class="level1">Pass a char * pointing to a file name for your private key. If not used, libcurl defaults to using <span Class="bold">~/.ssh/id_dsa</span>. If the file is password-protected, set the password with <a class="emphasis" href="#CURLOPTSSLKEYPASSWD">CURLOPT_SSLKEYPASSWD</a>. <a name="OTHER"></a><h2 class="nroffsh">OTHER OPTIONS</h2>
529
561
<p class="level0">
530
562
<p class="level0"><a name="CURLOPTPRIVATE"></a><span class="nroffip">CURLOPT_PRIVATE</span> 
531
563
<p class="level1">Pass a char * as parameter, pointing to data that should be associated with this curl handle.  The pointer can subsequently be retrieved using <a class="emphasis" href="./curl_easy_getinfo.html">curl_easy_getinfo(3)</a> with the CURLINFO_PRIVATE option. libcurl itself does nothing with this data. (Added in 7.10.3)