-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP/3, curl_ngtcp2, using ever increasing timestamp in io #11288
Conversation
- moved to qlog_write - crypto => encryption - CRYPTO => ENCRYPTION - removed "_is_" - ngtcp2_conn_shutdown_stream_read and ngtcp2_conn_shutdown_stream_write got flag arguments - the nghttp3_callbacks struct got a recv_settings callback
- nghttp3 0.12.0
- ngtcp2 v0.16.0 asserts that timestamps passed to its function will only ever increase. - Use a context shared between ingress/egress operations that uses a shared timestamp, regularly updated during calls. - based on curl#11184 that switched ngtcp2 and family version numbers
|
||
static ngtcp2_tstamp timestamp(void) | ||
{ | ||
struct curltime ct = Curl_now(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curl_now()
isn't guaranteed to always go forwards, in some situations it can jump back. For most modern platforms it is monotonic, however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition is a move, since the function is needed earlier in the code.
What is the alternative? Any recommendation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately guaranteed monotonic clock adds platform dependency. There is no fully portable and widely available way to get truly monotonic clock.
Traditionally clock_gettime(CLOCK_MONOTONIC, ..)
had been considered to be only increasing time stamp. However, for example macOS CLOCK_MONOTONIC
isn't always monotonic and can actually jump back.
Depending on what is needed CLOCK_MONOTONIC_RAW
might be suitable. This of course isn't available generally everywhere.
Reported-by: Harry Sintonen Ref: #11288
We can merge this and work on the clock independently, I created #11291 |
- ngtcp2 v0.16.0 asserts that timestamps passed to its function will only ever increase. - Use a context shared between ingress/egress operations that uses a shared timestamp, regularly updated during calls. Closes curl#11288
Reported-by: Harry Sintonen Ref: curl#11288 Closes curl#11291
- ngtcp2 v0.16.0 asserts that timestamps passed to its function will only ever increase. - Use a context shared between ingress/egress operations that uses a shared timestamp, regularly updated during calls. Closes curl#11288
Reported-by: Harry Sintonen Ref: curl#11288 Closes curl#11291
will only ever increase.
uses a shared timestamp, regularly updated during calls.