mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:51:42 +03:00
vquic: fix idle-timeout checks (ngtcp2 ms<-->ns), 64-bit log & honor 0=no-timeout (osslquic)
Closes #18903
This commit is contained in:
parent
357808f4ad
commit
0061b2bfaa
2 changed files with 7 additions and 5 deletions
|
|
@ -2744,8 +2744,9 @@ static bool cf_ngtcp2_conn_is_alive(struct Curl_cfilter *cf,
|
|||
* it will close the connection when it expires. */
|
||||
rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn);
|
||||
if(rp && rp->max_idle_timeout) {
|
||||
timediff_t idletime = curlx_timediff(curlx_now(), ctx->q.last_io);
|
||||
if(idletime > 0 && (uint64_t)idletime > rp->max_idle_timeout)
|
||||
timediff_t idletime_ms = curlx_timediff(curlx_now(), ctx->q.last_io);
|
||||
if(idletime_ms > 0 &&
|
||||
((uint64_t)idletime_ms * NGTCP2_MILLISECONDS) > rp->max_idle_timeout)
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2251,10 +2251,11 @@ static bool cf_osslq_conn_is_alive(struct Curl_cfilter *cf,
|
|||
"assume connection is dead.");
|
||||
goto out;
|
||||
}
|
||||
CURL_TRC_CF(data, cf, "negotiated idle timeout: %zums", (size_t)idle_ms);
|
||||
CURL_TRC_CF(data, cf, "negotiated idle timeout: %" FMT_PRIu64 "ms",
|
||||
(curl_uint64_t)idle_ms);
|
||||
idletime = curlx_timediff(curlx_now(), ctx->q.last_io);
|
||||
if(idletime > 0 && (uint64_t)idletime > idle_ms)
|
||||
goto out;
|
||||
if(idle_ms != 0 && idletime > 0 && (uint64_t)idletime > idle_ms)
|
||||
goto out;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue