gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 144/264: http: allow Curl_add_buffer_send() to do a short first


From: gnunet
Subject: [gnurl] 144/264: http: allow Curl_add_buffer_send() to do a short first send by force
Date: Thu, 30 Apr 2020 16:07:27 +0200

This is an automated email from the git hooks/post-receive script.

nikita pushed a commit to branch master
in repository gnurl.

commit 3e376059bbc6e5e56013c383f3ae3eef6c3ae8bb
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Apr 7 15:09:04 2020 +0200

    http: allow Curl_add_buffer_send() to do a short first send by force
    
    In a debug build, settting the environment variable "CURL_SMALLREQSEND"
    will make the first HTTP request send not send more bytes than the set
    amount, thus ending up verifying that the logic for handling a split
    HTTP request send works correctly.
---
 lib/http.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/http.c b/lib/http.c
index bff3adc17..e53f0d482 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1229,8 +1229,21 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer **inp,
     memcpy(data->state.ulbuf, ptr, sendsize);
     ptr = data->state.ulbuf;
   }
-  else
+  else {
+#ifdef CURLDEBUG
+    /* Allow debug builds override this logic to force short initial sends */
+    char *p = getenv("CURL_SMALLREQSEND");
+    if(p) {
+      size_t altsize = (size_t)strtoul(p, NULL, 10);
+      if(altsize)
+        sendsize = CURLMIN(size, altsize);
+      else
+        sendsize = size;
+    }
+    else
+#endif
     sendsize = size;
+  }
 
   result = Curl_write(conn, sockfd, ptr, sendsize, &amount);
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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