gnunet-svn
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]