aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/easy.c2
-rw-r--r--lib/ftp.c2
-rw-r--r--lib/telnet.c2
-rw-r--r--lib/url.c1
-rw-r--r--lib/urldata.h1
5 files changed, 4 insertions, 4 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 5189d0794..531f18b43 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -870,7 +870,7 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
* the likeliness of us forgetting to init a buffer here in the future.
*/
outcurl->set.buffer_size = data->set.buffer_size;
- outcurl->state.buffer = malloc(CURL_BUFSIZE(outcurl->set.buffer_size) + 1);
+ outcurl->state.buffer = malloc(outcurl->set.buffer_size + 1);
if(!outcurl->state.buffer)
goto fail;
diff --git a/lib/ftp.c b/lib/ftp.c
index a0ea7cad1..cd2abdef6 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2824,7 +2824,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
case FTP_PWD:
if(ftpcode == 257) {
char *ptr=&data->state.buffer[4]; /* start on the first letter */
- const size_t buf_size = CURL_BUFSIZE(data->set.buffer_size);
+ const size_t buf_size = data->set.buffer_size;
char *dir;
char *store;
diff --git a/lib/telnet.c b/lib/telnet.c
index bbdbb86ad..57d908c9c 100644
--- a/lib/telnet.c
+++ b/lib/telnet.c
@@ -1416,7 +1416,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done)
/* Keep on listening and act on events */
while(keepon) {
- const DWORD buf_size = (DWORD)CURL_BUFSIZE(data->set.buffer_size);
+ const DWORD buf_size = (DWORD)data->set.buffer_size;
waitret = WaitForMultipleObjects(obj_count, objs, FALSE, wait_timeout);
switch(waitret) {
case WAIT_TIMEOUT:
diff --git a/lib/url.c b/lib/url.c
index 04c03ac8d..965b5b57b 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -607,6 +607,7 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
set->expect_100_timeout = 1000L; /* Wait for a second by default. */
set->sep_headers = TRUE; /* separated header lists by default */
+ set->buffer_size = BUFSIZE;
Curl_http2_init_userset(set);
return result;
diff --git a/lib/urldata.h b/lib/urldata.h
index b300d8a69..0cedfa817 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -206,7 +206,6 @@
#undef MAX_BUFSIZE
#define MAX_BUFSIZE CURL_MAX_READ_SIZE
#define MIN_BUFSIZE 1024
-#define CURL_BUFSIZE(x) ((x)?(x):(BUFSIZE))
/* Initial size of the buffer to store headers in, it'll be enlarged in case
of need. */