aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/http.c15
1 files changed, 14 insertions, 1 deletions
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);