mirror of
https://github.com/curl/curl.git
synced 2026-07-27 15:48:56 +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
|
|
@ -4980,7 +4980,7 @@ static CURLcode cr_exp100_read(struct Curl_easy *data,
|
|||
DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE, "
|
||||
"timeout %dms", data->set.expect_100_timeout));
|
||||
ctx->state = EXP100_AWAITING_CONTINUE;
|
||||
ctx->start = data->progress.now;
|
||||
ctx->start = *Curl_pgrs_now(data);
|
||||
Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT);
|
||||
*nread = 0;
|
||||
*eos = FALSE;
|
||||
|
|
@ -4991,7 +4991,7 @@ static CURLcode cr_exp100_read(struct Curl_easy *data,
|
|||
*eos = FALSE;
|
||||
return CURLE_READ_ERROR;
|
||||
case EXP100_AWAITING_CONTINUE:
|
||||
ms = curlx_timediff_ms(data->progress.now, ctx->start);
|
||||
ms = curlx_ptimediff_ms(Curl_pgrs_now(data), &ctx->start);
|
||||
if(ms < data->set.expect_100_timeout) {
|
||||
DEBUGF(infof(data, "cr_exp100_read, AWAITING_CONTINUE, not expired"));
|
||||
*nread = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue