mirror of
https://github.com/curl/curl.git
synced 2026-08-14 15:33:39 +03:00
ratelimit: reset on start
On any `Curl_rlimit_start()` the rate limit needs to reset its values before calculating the effective step duration and adjust the tokens/burst per step. Add two fields to the struct to remember the original values. Closes #21086
This commit is contained in:
parent
372d721e92
commit
797bc316bf
2 changed files with 10 additions and 3 deletions
|
|
@ -55,6 +55,8 @@ struct Curl_easy;
|
|||
*/
|
||||
|
||||
struct Curl_rlimit {
|
||||
int64_t rate_per_sec; /* rate tokens generated per second */
|
||||
int64_t burst_per_sec; /* burst rate of tokens per second */
|
||||
int64_t rate_per_step; /* rate tokens generated per step us */
|
||||
int64_t burst_per_step; /* burst rate of tokens per step us */
|
||||
timediff_t step_us; /* microseconds between token increases */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue