mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:23:38 +03:00
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:
parent
ca27404d27
commit
78a610cb83
53 changed files with 187 additions and 188 deletions
|
|
@ -3124,7 +3124,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data,
|
|||
|
||||
while((sshc->state != SSH_STOP) && !result) {
|
||||
bool block;
|
||||
timediff_t left = 1000;
|
||||
timediff_t left_ms = 1000;
|
||||
struct curltime now = curlx_now();
|
||||
|
||||
result = ssh_statemachine(data, sshc, sshp, &block);
|
||||
|
|
@ -3139,13 +3139,13 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data,
|
|||
if(result)
|
||||
break;
|
||||
|
||||
left = Curl_timeleft(data, NULL, FALSE);
|
||||
if(left < 0) {
|
||||
left_ms = Curl_timeleft_ms(data, NULL, FALSE);
|
||||
if(left_ms < 0) {
|
||||
failf(data, "Operation timed out");
|
||||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
}
|
||||
else if(curlx_timediff(now, dis) > 1000) {
|
||||
else if(curlx_timediff_ms(now, dis) > 1000) {
|
||||
/* disconnect timeout */
|
||||
failf(data, "Disconnect timed out");
|
||||
result = CURLE_OK;
|
||||
|
|
@ -3163,7 +3163,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data,
|
|||
fd_write = sock;
|
||||
/* wait for the socket to become ready */
|
||||
(void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, fd_write,
|
||||
left > 1000 ? 1000 : left);
|
||||
left_ms > 1000 ? 1000 : left_ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue