mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:43:52 +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
|
|
@ -230,7 +230,7 @@ static CURLcode cw_download_write(struct Curl_easy *data,
|
|||
if(!ctx->started_response &&
|
||||
!(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
|
||||
Curl_pgrsTime(data, TIMER_STARTTRANSFER);
|
||||
Curl_rlimit_start(&data->progress.dl.rlimit, &data->progress.now);
|
||||
Curl_rlimit_start(&data->progress.dl.rlimit, Curl_pgrs_now(data));
|
||||
ctx->started_response = TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1202,13 +1202,13 @@ CURLcode Curl_client_read(struct Curl_easy *data, char *buf, size_t blen,
|
|||
DEBUGASSERT(data->req.reader_stack);
|
||||
}
|
||||
if(!data->req.reader_started) {
|
||||
Curl_rlimit_start(&data->progress.ul.rlimit, &data->progress.now);
|
||||
Curl_rlimit_start(&data->progress.ul.rlimit, Curl_pgrs_now(data));
|
||||
data->req.reader_started = TRUE;
|
||||
}
|
||||
|
||||
if(Curl_rlimit_active(&data->progress.ul.rlimit)) {
|
||||
curl_off_t ul_avail =
|
||||
Curl_rlimit_avail(&data->progress.ul.rlimit, &data->progress.now);
|
||||
curl_off_t ul_avail = Curl_rlimit_avail(&data->progress.ul.rlimit,
|
||||
Curl_pgrs_now(data));
|
||||
if(ul_avail <= 0) {
|
||||
result = CURLE_OK;
|
||||
*eos = FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue