lib: rename curlx_timediff to curlx_timeleft_ms

Rename `Curl_timeleft()` to `Curl_timeleft_ms()` to make the units in
the returned `timediff_t` clear. (We used to always have ms there, but
with QUIC started to sometimes calc ns as well).

Rename some assigned vars without `_ms` suffix for clarity as well.

Closes #19486
This commit is contained in:
Stefan Eissing 2025-11-12 12:15:42 +01:00 committed by Daniel Stenberg
parent ca27404d27
commit 78a610cb83
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
53 changed files with 187 additions and 188 deletions

View file

@ -422,18 +422,18 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp)
goto out;
if(k->keepon) {
if(0 > Curl_timeleft(data, nowp, FALSE)) {
if(Curl_timeleft_ms(data, nowp, FALSE) < 0) {
if(k->size != -1) {
failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
" milliseconds with %" FMT_OFF_T " out of %"
FMT_OFF_T " bytes received",
curlx_timediff(*nowp, data->progress.t_startsingle),
curlx_timediff_ms(*nowp, data->progress.t_startsingle),
k->bytecount, k->size);
}
else {
failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
" milliseconds with %" FMT_OFF_T " bytes received",
curlx_timediff(*nowp, data->progress.t_startsingle),
curlx_timediff_ms(*nowp, data->progress.t_startsingle),
k->bytecount);
}
result = CURLE_OPERATION_TIMEDOUT;