mirror of
https://github.com/curl/curl.git
synced 2026-08-25 17:33:32 +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
|
|
@ -2069,7 +2069,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
}
|
||||
else {
|
||||
send_timeout_ms = 0;
|
||||
if(data->set.max_send_speed > 0)
|
||||
if(data->set.max_send_speed)
|
||||
send_timeout_ms =
|
||||
Curl_pgrsLimitWaitTime(data->progress.uploaded,
|
||||
data->progress.ul_limit_size,
|
||||
|
|
@ -2078,7 +2078,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
*nowp);
|
||||
|
||||
recv_timeout_ms = 0;
|
||||
if(data->set.max_recv_speed > 0)
|
||||
if(data->set.max_recv_speed)
|
||||
recv_timeout_ms =
|
||||
Curl_pgrsLimitWaitTime(data->progress.downloaded,
|
||||
data->progress.dl_limit_size,
|
||||
|
|
@ -2105,7 +2105,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
DEBUGASSERT(data->state.buffer);
|
||||
/* check if over send speed */
|
||||
send_timeout_ms = 0;
|
||||
if(data->set.max_send_speed > 0)
|
||||
if(data->set.max_send_speed)
|
||||
send_timeout_ms = Curl_pgrsLimitWaitTime(data->progress.uploaded,
|
||||
data->progress.ul_limit_size,
|
||||
data->set.max_send_speed,
|
||||
|
|
@ -2114,7 +2114,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
|
||||
/* check if over recv speed */
|
||||
recv_timeout_ms = 0;
|
||||
if(data->set.max_recv_speed > 0)
|
||||
if(data->set.max_recv_speed)
|
||||
recv_timeout_ms = Curl_pgrsLimitWaitTime(data->progress.downloaded,
|
||||
data->progress.dl_limit_size,
|
||||
data->set.max_recv_speed,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue