-
Notifications
You must be signed in to change notification settings - Fork 756
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
qlog: Update ConnectionClose with CryptoError #1734
base: master
Are you sure you want to change the base?
qlog: Update ConnectionClose with CryptoError #1734
Conversation
This makes the qlog crate fit the specification laid out in quicwg/qlog#392
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] | ||
#[serde(untagged)] | ||
pub enum ConnectionCloseErrorCode { | ||
CryptoError(CryptoError), |
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.
Need to add all the variants in https://quicwg.org/qlog/draft-ietf-quic-qlog-quic-events.html#name-connectioncloseframe
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] | ||
#[serde(untagged)] | ||
pub enum ConnectionCloseErrorCode { | ||
CryptoError(CryptoError), |
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 CryptoError type also needs to be updated to reflect the latest qlog spec - https://quicwg.org/qlog/draft-ietf-quic-qlog-quic-events.html#section-8.12.25
error_code_value: None, // raw error is no different for us | ||
// TODO: determine if connection is established so we can log | ||
// CryptoErrors | ||
error_code: Some(ConnectionCloseErrorCode::Numeric(*error_code)), |
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.
I think what we want to do instead convert all the known error codes to actual qlog transport or crypto errors, rather than a numeric one
// TODO: determine if connection is established so we can log | ||
// CryptoErrors | ||
error_code: Some(ConnectionCloseErrorCode::Numeric( | ||
*error_code, | ||
)), |
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.
CryptoErrors cannot be sent in application close. And at the point we log things here, we don't know the application protocol. So I think its safe to just log the Numeric variant without a comment.
This makes the qlog crate fit the specification laid out in quicwg/qlog#392.
This yields the following
ConnectionClose
frame:We won't be able to log
CryptoError
s without a larger change that pushes detection of connection establishment into the qlog crate. We could also explore logging one of two differentConnectionClose
events on close, one each for pre- and post-establishment, but that seemed messy. I can implement that if we do want to go down that route.