Debian Codegraph @

deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD_BUFFERSIZE.3

raw
1 .\" **************************************************************************
2 .\" * _ _ ____ _
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <[email protected]>, 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 https://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 CURLOPT_UPLOAD_BUFFERSIZE 3 "18 Aug 2018" "libcurl 7.62.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_UPLOAD_BUFFERSIZE \- set preferred upload buffer size
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UPLOAD_BUFFERSIZE, long size);
30 .SH DESCRIPTION
31 Pass a long specifying your preferred \fIsize\fP (in bytes) for the upload
32 buffer in libcurl. It makes libcurl uses a larger buffer that gets passed to
33 the next layer in the stack to get sent off. In some setups and for some
34 protocols, there's a huge performance benefit of having a larger upload
35 buffer.
36
37 This is just treated as a request, not an order. You cannot be guaranteed to
38 actually get the given size.
39
40 The upload buffer size is by default 64 kilobytes. The maximum buffer size
41 allowed to be set is 2 megabytes. The minimum buffer size allowed to be set is
42 16 kilobytes.
43
44 Since curl 7.61.1 the upload buffer is allocated on-demand - so if the handle
45 isn't used for upload, this buffer will not be allocated at all.
46 .SH DEFAULT
47 64 kB
48 .SH PROTOCOLS
49 All
50 .SH EXAMPLE
51 .nf
52 CURL *curl = curl_easy_init();
53 if(curl) {
54 curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/foo.bin");
55
56 /* ask libcurl to allocate a larger upload buffer */
57 curl_easy_setopt(curl, CURLOPT_UPLOAD_BUFFERSIZE, 120000L);
58
59 ret = curl_easy_perform(curl);
60
61 curl_easy_cleanup(curl);
62 }
63 .fi
64 .SH AVAILABILITY
65 Added in 7.62.0.
66 .SH RETURN VALUE
67 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
68 .SH "SEE ALSO"
69 .BR CURLOPT_BUFFERSIZE "(3), " CURLOPT_READFUNCTION "(3), "