mirror of
https://github.com/curl/curl.git
synced 2026-08-24 13:03:35 +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
|
|
@ -3179,7 +3179,7 @@ static CURLcode ftp_connect(struct Curl_easy *data,
|
|||
conn->bits.ftp_use_control_ssl = TRUE;
|
||||
}
|
||||
|
||||
Curl_pp_init(pp, &data->progress.now); /* once per transfer */
|
||||
Curl_pp_init(pp, Curl_pgrs_now(data)); /* once per transfer */
|
||||
|
||||
/* When we connect, we start in the state where we await the 220
|
||||
response */
|
||||
|
|
@ -3315,7 +3315,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
|
|||
* data has been transferred. This happens when doing through NATs etc that
|
||||
* abandon old silent connections.
|
||||
*/
|
||||
pp->response = data->progress.now; /* timeout relative now */
|
||||
pp->response = *Curl_pgrs_now(data); /* timeout relative now */
|
||||
result = getftpresponse(data, &nread, &ftpcode);
|
||||
|
||||
if(!nread && (CURLE_OPERATION_TIMEDOUT == result)) {
|
||||
|
|
@ -3435,7 +3435,7 @@ static CURLcode ftp_sendquote(struct Curl_easy *data,
|
|||
|
||||
result = Curl_pp_sendf(data, &ftpc->pp, "%s", cmd);
|
||||
if(!result) {
|
||||
pp->response = data->progress.now; /* timeout relative now */
|
||||
pp->response = *Curl_pgrs_now(data); /* timeout relative now */
|
||||
result = getftpresponse(data, &nread, &ftpcode);
|
||||
}
|
||||
if(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue