diff options
author | Richy Kim <richy@fb.com> | 2016-12-20 05:48:15 -0500 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-01-19 23:38:04 +0100 |
commit | 6b7616690e5370c21e3a760321af6bf4edbabfb6 (patch) | |
tree | 15ff13a118a311f3a604686103b6d0eaaee6ced4 /lib/file.c | |
parent | 81cb255cb355ca35453e7297af9cbc8ff7798416 (diff) | |
download | curl-6b7616690e5370c21e3a760321af6bf4edbabfb6.tar.gz |
CURLOPT_BUFFERSIZE: support enlarging receive buffer
Replace use of fixed macro BUFSIZE to define the size of the receive
buffer. Reappropriate CURLOPT_BUFFERSIZE to include enlarging receive
buffer size. Upon setting, resize buffer if larger than the current
default size up to a MAX_BUFSIZE (512KB). This can benefit protocols
like SFTP.
Closes #1222
Diffstat (limited to 'lib/file.c')
-rw-r--r-- | lib/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/file.c b/lib/file.c index 3dbc0f2b8..e90902c50 100644 --- a/lib/file.c +++ b/lib/file.c @@ -476,7 +476,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done) time_t filetime; struct tm buffer; const struct tm *tm = &buffer; - snprintf(buf, sizeof(data->state.buffer), + snprintf(buf, CURL_BUFSIZE(data->set.buffer_size), "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", expected_size); result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); if(result) |