mirror of
https://github.com/curl/curl.git
synced 2026-07-22 16:27:15 +03:00
lib: ratelimit timestamps
Remove the timestamp passed for ratelimit checks. Let the limit calculation obtain a timestamp when it needs it. Most transfers run without active ratelimits and getting a fresh timestamp is unnecessary. Closes #22292
This commit is contained in:
parent
c3ae9ef822
commit
34bc5b60bc
10 changed files with 31 additions and 23 deletions
|
|
@ -172,10 +172,8 @@ UNITTEST CURLcode pgrs_speedcheck(struct Curl_easy *data,
|
|||
|
||||
const struct curltime *Curl_pgrs_now(struct Curl_easy *data)
|
||||
{
|
||||
struct curltime *pnow = data->multi ?
|
||||
&data->multi->now : &data->progress.now;
|
||||
curlx_pnow(pnow);
|
||||
return pnow;
|
||||
curlx_pnow(&data->progress.now);
|
||||
return &data->progress.now;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -392,7 +390,7 @@ void Curl_pgrs_download_inc(struct Curl_easy *data, size_t delta)
|
|||
{
|
||||
if(delta) {
|
||||
data->progress.dl.cur_size += delta;
|
||||
Curl_rlimit_drain(&data->progress.dl.rlimit, delta, Curl_pgrs_now(data));
|
||||
Curl_rlimit_drain(&data->progress.dl.rlimit, delta, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -400,7 +398,7 @@ void Curl_pgrs_upload_inc(struct Curl_easy *data, size_t delta)
|
|||
{
|
||||
if(delta) {
|
||||
data->progress.ul.cur_size += delta;
|
||||
Curl_rlimit_drain(&data->progress.ul.rlimit, delta, Curl_pgrs_now(data));
|
||||
Curl_rlimit_drain(&data->progress.ul.rlimit, delta, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue