diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2023-02-26 03:44:38 -0500 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2023-03-01 01:15:28 -0500 |
commit | 0b84d0cf1bf726189a4ecf3339735ac2f6b404f4 (patch) | |
tree | 393cb146013e8d556f7f0edc0e919d403204ec80 /lib/urldata.h | |
parent | a496d46a7b4c220ab2e62c2189d6fd50d123f201 (diff) | |
download | curl-0b84d0cf1bf726189a4ecf3339735ac2f6b404f4.tar.gz |
transfer: limit Windows SO_SNDBUF updates to once a second
- Change readwrite_upload() to call win_update_buffer_size() no more
than once a second to update SO_SNDBUF (send buffer limit).
Prior to this change during an upload readwrite_upload() could call
win_update_buffer_size() anywhere from hundreds of times per second to
an extreme test case of 100k per second (which is likely due to a bug,
see #10618). In the latter case WPA profiler showed
win_update_buffer_size was the highest capture count in
readwrite_upload. In any case the calls were excessive and unnecessary.
Ref: https://github.com/curl/curl/pull/2762
Closes https://github.com/curl/curl/pull/10611
Diffstat (limited to 'lib/urldata.h')
-rw-r--r-- | lib/urldata.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/urldata.h b/lib/urldata.h index ca8e3074d..d7d104d41 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -687,6 +687,10 @@ struct SingleRequest { #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. */ BIT(header); /* incoming data has HTTP header */ |