aboutsummaryrefslogtreecommitdiff
path: root/lib/sendf.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-02-27 09:42:11 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-02-27 10:35:51 +0100
commit15f51474c837679c0b79825c23356ac681ffabde (patch)
tree74a8f65771ab4108f09d66b0272892089e861ecb /lib/sendf.c
parent507cf6a13db0375eadd4655b4c64710db29e9cf2 (diff)
http2: make pausing/unpausing set/clear local stream window
This reduces the HTTP/2 window size to 32 MB since libcurl might have to buffer up to this amount of data in memory and yet we don't want it set lower to potentially impact tranfer performance on high speed networks. Requires nghttp2 commit b3f85e2daa629 (https://github.com/nghttp2/nghttp2/pull/1444) to work properly, to end up in the next release after 1.40.0. Fixes #4939 Closes #4940
Diffstat (limited to 'lib/sendf.c')
-rw-r--r--lib/sendf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index 51bbca75e..6ef47aa80 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -43,6 +43,7 @@
#include "strerror.h"
#include "select.h"
#include "strdup.h"
+#include "http2.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -501,6 +502,9 @@ static CURLcode pausewrite(struct Curl_easy *data,
unsigned int i;
bool newtype = TRUE;
+ /* If this transfers over HTTP/2, pause the stream! */
+ Curl_http2_stream_pause(data, TRUE);
+
if(s->tempcount) {
for(i = 0; i< s->tempcount; i++) {
if(s->tempwrite[i].type == type) {
@@ -529,6 +533,8 @@ static CURLcode pausewrite(struct Curl_easy *data,
/* update the pointer and the size */
s->tempwrite[i].buf = newptr;
s->tempwrite[i].len = newlen;
+
+ len = newlen; /* for the debug output below */
}
else {
dupl = Curl_memdup(ptr, len);