From 6b7616690e5370c21e3a760321af6bf4edbabfb6 Mon Sep 17 00:00:00 2001 From: Richy Kim Date: Tue, 20 Dec 2016 05:48:15 -0500 Subject: 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 --- include/curl/curl.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/curl/curl.h b/include/curl/curl.h index 74ac0350e..467bb0240 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -193,6 +193,11 @@ typedef int (*curl_xferinfo_callback)(void *clientp, curl_off_t ultotal, curl_off_t ulnow); +#ifndef CURL_MAX_READ_SIZE + /* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */ +#define CURL_MAX_READ_SIZE 524288 +#endif + #ifndef CURL_MAX_WRITE_SIZE /* Tests have proven that 20K is a very bad buffer size for uploads on Windows, while 16K for some odd reason performed a lot better. -- cgit v1.2.3