aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
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/http.c
parent81cb255cb355ca35453e7297af9cbc8ff7798416 (diff)
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/http.c')
-rw-r--r--lib/http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index fdaecafdc..2066520e7 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -297,7 +297,8 @@ static CURLcode http_output_basic(struct connectdata *conn, bool proxy)
pwd = conn->passwd;
}
- snprintf(data->state.buffer, sizeof(data->state.buffer), "%s:%s", user, pwd);
+ snprintf(data->state.buffer, CURL_BUFSIZE(data->set.buffer_size),
+ "%s:%s", user, pwd);
result = Curl_base64_encode(data,
data->state.buffer, strlen(data->state.buffer),