summaryrefslogtreecommitdiff
path: root/lib/sendf.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-05-06 13:04:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-05-08 10:49:16 +0200
commit51c0ebcff2140c38ff389b4fcfb8216f5e9d198c (patch)
treee4d6c1b35c99cae1e2fe054e1bab69bae07e33f7 /lib/sendf.c
parent63813a0325adec659bdb6866c061208266b68797 (diff)
downloadcurl-51c0ebcff2140c38ff389b4fcfb8216f5e9d198c.tar.gz
http: deal with partial CONNECT sends
Also added 'CURL_SMALLSENDS' to make Curl_write() send short packets, which helped verifying this even more. Add test 363 to verify. Reported-by: ustcqidi on github Fixes #6950 Closes #7024
Diffstat (limited to 'lib/sendf.c')
-rw-r--r--lib/sendf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index fa3c5a35d..e41bb805f 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -309,6 +309,18 @@ CURLcode Curl_write(struct Curl_easy *data,
conn = data->conn;
num = (sockfd == conn->sock[SECONDARYSOCKET]);
+#ifdef CURLDEBUG
+ {
+ /* Allow debug builds to override this logic to force short sends
+ */
+ char *p = getenv("CURL_SMALLSENDS");
+ if(p) {
+ size_t altsize = (size_t)strtoul(p, NULL, 10);
+ if(altsize)
+ len = CURLMIN(len, altsize);
+ }
+ }
+#endif
bytes_written = conn->send[num](data, num, mem, len, &result);
*written = bytes_written;