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:
Stefan Eissing 2026-07-10 11:47:48 +02:00 committed by Daniel Stenberg
parent c3ae9ef822
commit 34bc5b60bc
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 31 additions and 23 deletions

View file

@ -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);
}
}