mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:53:34 +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
|
|
@ -266,7 +266,7 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn,
|
|||
struct Curl_easy *data,
|
||||
int timeout_ms)
|
||||
{
|
||||
struct curltime started = data->progress.now;
|
||||
struct curltime started = *Curl_pgrs_now(data);
|
||||
struct Curl_llist_node *e;
|
||||
SIGPIPE_VARIABLE(pipe_st);
|
||||
|
||||
|
|
@ -289,8 +289,7 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn,
|
|||
}
|
||||
|
||||
/* wait for activity, timeout or "nothing" */
|
||||
Curl_pgrs_now_set(data); /* update in loop */
|
||||
spent_ms = curlx_timediff_ms(data->progress.now, started);
|
||||
spent_ms = curlx_ptimediff_ms(Curl_pgrs_now(data), &started);
|
||||
if(spent_ms >= (timediff_t)timeout_ms) {
|
||||
CURL_TRC_M(data, "[SHUTDOWN] shutdown finished, %s",
|
||||
(timeout_ms > 0) ? "timeout" : "best effort done");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue