diff --git a/lib/transfer.c b/lib/transfer.c index 69df214ce4..27843f50cc 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -980,7 +980,15 @@ static CURLcode readwrite_upload(struct Curl_easy *data, if(result) return result; - win_update_buffer_size(conn->writesockfd); +#if defined(WIN32) && defined(USE_WINSOCK) + { + struct curltime n = Curl_now(); + if(Curl_timediff(n, k->last_sndbuf_update) > 1000) { + win_update_buffer_size(conn->writesockfd); + k->last_sndbuf_update = n; + } + } +#endif if(k->pendingheader) { /* parts of what was sent was header */ diff --git a/lib/urldata.h b/lib/urldata.h index ca8e3074d7..d7d104d419 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -686,6 +686,10 @@ struct SingleRequest { } p; #ifndef CURL_DISABLE_DOH struct dohdata *doh; /* DoH specific data for this request */ +#endif +#if defined(WIN32) && defined(USE_WINSOCK) + struct curltime last_sndbuf_update; /* last time readwrite_upload called + win_update_buffer_size */ #endif unsigned char setcookies; unsigned char writer_stack_depth; /* Unencoding stack depth. */