http/2, better rate limiting of downloads #14326
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Set the initial stream window size to 64KB and increase that to the 10MB we used to start with on the first server reply, unless a rate limit is in effect.
Continuously monitory changes to the transfers rate limit and adjust the stream window size accordingly.
max_recv_speed
is a transfer propert that can be changed during processing by a callback.The problem with the previous start of 10MB initially is that a server may push this amount into the TCP connection. If this is the only transfer on that connection, curl will just slowly consume this, possibly leading to timeouts on the server side. With more than one transfer, the unrestricted transfer will keep in pulling data and curl needs to take in all data, possibly 10MB, of the throttled stream then without restrictions.