[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 57/254: buffer_size: make sure it always has the co
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 57/254: buffer_size: make sure it always has the correct size |
Date: |
Sat, 17 Jun 2017 16:51:29 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit f535f4f5fc6cbdce1aec5a3481cec37369dca468
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Apr 25 00:16:10 2017 +0200
buffer_size: make sure it always has the correct size
Removes the need for CURL_BUFSIZE
---
lib/easy.c | 2 +-
lib/ftp.c | 2 +-
lib/telnet.c | 2 +-
lib/url.c | 1 +
lib/urldata.h | 1 -
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. */
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 30/254: lib: remove unused code, (continued)
- [GNUnet-SVN] [gnurl] 30/254: lib: remove unused code, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 102/254: opts: fix bad example formatting \n => \\n, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 86/254: curl: fix warning "comma at end of enumerator list", gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 61/254: failf: use private buffer, don't clobber receive buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 92/254: runtests: use -R for random order, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 71/254: url: let CURLOPT_BUFFERSIZE realloc to smaller sizes too, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 42/254: unit1604: fixed compilation under Windows, broken in the previous commit, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 38/254: tests: added --remote-time tests for remaining protocols that support it, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 41/254: tests: fixed OOM handling of unit tests to abort test, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 55/254: CURLOPT_BUFFERSIZE: 1024 bytes is now the minimum size, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 57/254: buffer_size: make sure it always has the correct size,
gnunet <=
- [GNUnet-SVN] [gnurl] 105/254: asyn-thread: fix unused macro warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 73/254: gtls: fixed a lingering BUFSIZE reference, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 70/254: BUFSIZE: rename to READBUFFER_*, make separate MASTERBUF_SIZE, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 149/254: cmdline-opts/write-out.d: s/-L/--location, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 99/254: runtests.pl: simplify the datacheck read section, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 44/254: http2: declare TU-local variables static, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 54/254: ftp: use private buffer for temp storage, not receive buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 81/254: lib: fix compiler warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 47/254: tool_cb_prg: fix double-promotion warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 63/254: http-proxy: use a dedicated CONNECT response buffer, gnunet, 2017/06/17