mirror of
https://github.com/curl/curl.git
synced 2026-08-25 12:03:39 +03:00
send_speed: simplify the checks for if a speed limit is set
... as we know the value cannot be set to negative: enforced by setopt()
This commit is contained in:
parent
24e469f6d6
commit
b5726e5549
3 changed files with 7 additions and 7 deletions
|
|
@ -321,14 +321,14 @@ void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size)
|
|||
void Curl_ratelimit(struct Curl_easy *data, struct curltime now)
|
||||
{
|
||||
/* don't set a new stamp unless the time since last update is long enough */
|
||||
if(data->set.max_recv_speed > 0) {
|
||||
if(data->set.max_recv_speed) {
|
||||
if(Curl_timediff(now, data->progress.dl_limit_start) >=
|
||||
MIN_RATE_LIMIT_PERIOD) {
|
||||
data->progress.dl_limit_start = now;
|
||||
data->progress.dl_limit_size = data->progress.downloaded;
|
||||
}
|
||||
}
|
||||
if(data->set.max_send_speed > 0) {
|
||||
if(data->set.max_send_speed) {
|
||||
if(Curl_timediff(now, data->progress.ul_limit_start) >=
|
||||
MIN_RATE_LIMIT_PERIOD) {
|
||||
data->progress.ul_limit_start = now;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue