mirror of
https://github.com/curl/curl.git
synced 2026-07-26 01:27:15 +03:00
time-keeping: keep timestamp in multi, always update
Always use curlx_now() when calling Curl_pgrs_now(data). Tests with the "manual" updates to now proved differ more then 100ms in parallel testing. Add `curlx_nowp()` to set current time into a struct curltime. Add `curlx_ptimediff_ms() and friends, passing pointers. Update documentation. Closes #19998
This commit is contained in:
parent
308c347c8b
commit
b4be1f271e
61 changed files with 471 additions and 502 deletions
|
|
@ -3119,13 +3119,12 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data,
|
|||
bool disconnect)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct curltime start = data->progress.now;
|
||||
struct curltime start = *Curl_pgrs_now(data);
|
||||
|
||||
while((sshc->state != SSH_STOP) && !result) {
|
||||
bool block;
|
||||
timediff_t left_ms = 1000;
|
||||
|
||||
Curl_pgrs_now_set(data); /* timeout disconnect */
|
||||
result = ssh_statemachine(data, sshc, sshp, &block);
|
||||
if(result)
|
||||
break;
|
||||
|
|
@ -3141,7 +3140,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data,
|
|||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
}
|
||||
else if(curlx_timediff_ms(data->progress.now, start) > 1000) {
|
||||
else if(curlx_ptimediff_ms(Curl_pgrs_now(data), &start) > 1000) {
|
||||
/* disconnect timeout */
|
||||
failf(data, "Disconnect timed out");
|
||||
result = CURLE_OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue