summaryrefslogtreecommitdiff
path: root/lib/urldata.h
diff options
context:
space:
mode:
authorRichy Kim <richy@fb.com>2016-12-20 05:48:15 -0500
committerDaniel Stenberg <daniel@haxx.se>2017-01-19 23:38:04 +0100
commit6b7616690e5370c21e3a760321af6bf4edbabfb6 (patch)
tree15ff13a118a311f3a604686103b6d0eaaee6ced4 /lib/urldata.h
parent81cb255cb355ca35453e7297af9cbc8ff7798416 (diff)
downloadcurl-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/urldata.h')
-rw-r--r--lib/urldata.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/urldata.h b/lib/urldata.h
index 96c0aca19..20057effa 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -201,6 +201,9 @@
/* Download buffer size, keep it fairly big for speed reasons */
#undef BUFSIZE
#define BUFSIZE CURL_MAX_WRITE_SIZE
+#undef MAX_BUFSIZE
+#define MAX_BUFSIZE CURL_MAX_READ_SIZE
+#define CURL_BUFSIZE(x) ((x)?(x):(BUFSIZE))
/* Initial size of the buffer to store headers in, it'll be enlarged in case
of need. */
@@ -1304,7 +1307,7 @@ struct UrlState {
char *headerbuff; /* allocated buffer to store headers in */
size_t headersize; /* size of the allocation */
- char buffer[BUFSIZE+1]; /* download buffer */
+ char *buffer; /* download buffer */
char uploadbuffer[BUFSIZE+1]; /* upload buffer */
curl_off_t current_speed; /* the ProgressShow() funcion sets this,
bytes / second */