1CURLOPT_UPLOAD_BUFFERSIZE(3)curl_easy_setopt optionsCURLOPT_UPLOAD_BUFFERSIZE(3)
2
3
4

NAME

6       CURLOPT_UPLOAD_BUFFERSIZE - set preferred upload buffer size
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UPLOAD_BUFFERSIZE, long
12       size);
13

DESCRIPTION

15       Pass a long specifying your preferred size (in bytes)  for  the  upload
16       buffer  in  libcurl.  It  makes  libcurl uses a larger buffer that gets
17       passed to the next layer in the stack to get sent off. In  some  setups
18       and  for some protocols, there's a huge performance benefit of having a
19       larger upload buffer.
20
21       This is just treated as a request, not an order. You cannot be  guaranā€
22       teed to actually get the given size.
23
24       The  upload  buffer size is by default 64 kilobytes. The maximum buffer
25       size allowed to be set is 2 megabytes. The minimum buffer size  allowed
26       to be set is 16 kilobytes.
27
28       Since  curl 7.61.1 the upload buffer is allocated on-demand - so if the
29       handle isn't used for upload, this buffer will not be allocated at all.
30

DEFAULT

32       64 kB
33

PROTOCOLS

35       All
36

EXAMPLE

38       CURL *curl = curl_easy_init();
39       if(curl) {
40         curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/foo.bin");
41
42         /* ask libcurl to allocate a larger upload buffer */
43         curl_easy_setopt(curl, CURLOPT_UPLOAD_BUFFERSIZE, 120000L);
44
45         ret = curl_easy_perform(curl);
46
47         curl_easy_cleanup(curl);
48       }
49

AVAILABILITY

51       Added in 7.62.0.
52

RETURN VALUE

54       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
55       if not.
56

SEE ALSO

58       CURLOPT_BUFFERSIZE(3), CURLOPT_READFUNCTION(3),
59
60
61
62libcurl 7.76.1                 November 04, 2020  CURLOPT_UPLOAD_BUFFERSIZE(3)
Impressum