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