[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.
- [gnurl] 169/264: tests/server: add CTRL event handler for Win32 consoles, (continued)
- [gnurl] 169/264: tests/server: add CTRL event handler for Win32 consoles, gnunet, 2020/04/30
- [gnurl] 243/264: libcurl-multi.3: added missing full stop, gnunet, 2020/04/30
- [gnurl] 209/264: tests: move pingpong server to dynamic listening port, gnunet, 2020/04/30
- [gnurl] 184/264: tests: add the mqtt test server mqttd, gnunet, 2020/04/30
- [gnurl] 210/264: test1028: make it run on dynamic FTP server port, gnunet, 2020/04/30
- [gnurl] 211/264: test1055: make it work with dynamic FTP port, gnunet, 2020/04/30
- [gnurl] 176/264: appveyor: completely disable tests that fail to timeout early, gnunet, 2020/04/30
- [gnurl] 139/264: release-notes: output trailing references sorted numerically, gnunet, 2020/04/30
- [gnurl] 244/264: select: make Curl_socket_check take timediff_t timeout, gnunet, 2020/04/30
- [gnurl] 150/264: release-notes: fix the initial reference list output, gnunet, 2020/04/30
- [gnurl] 144/264: http: allow Curl_add_buffer_send() to do a short first send by force,
gnunet <=
- [gnurl] 262/264: RELEASE-NOTES: 7.70.0, gnunet, 2020/04/30
- [gnurl] 159/264: lib: fix conversion warnings for SOCKET_WRITABLE/READABLE, gnunet, 2020/04/30
- [gnurl] 182/264: mqtt: add new experimental protocol, gnunet, 2020/04/30
- [gnurl] 145/264: http: don't consider upload done if the request isn't completely sent off, gnunet, 2020/04/30
- [gnurl] 181/264: TODO: Consider convenience options for JSON and XML?, gnunet, 2020/04/30
- [gnurl] 143/264: connect: store connection info for QUIC connections, gnunet, 2020/04/30
- [gnurl] 148/264: runtests: provide nicer errormsg when protocol "dump" file is empty, gnunet, 2020/04/30
- [gnurl] 258/264: nss: check for PK11_CreateDigestContext() returning NULL, gnunet, 2020/04/30
- [gnurl] 151/264: runtests: fix warning about using an undefined variable, gnunet, 2020/04/30
- [gnurl] 153/264: url: allow non-HTTPS altsvc-matching for debug builds, gnunet, 2020/04/30