Skip to content
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

support 62-bit error codes #602

Merged
merged 23 commits into from
Jan 12, 2025
Merged

support 62-bit error codes #602

merged 23 commits into from
Jan 12, 2025

Conversation

kazuho
Copy link
Member

@kazuho kazuho commented Jan 12, 2025

As discussed in #601, at the moment quicly uses int for passing errors. This made sense when the early draft versions of QUIC used 16-bit error code space, but not any more. The standardized QUIC uses two 62-bit error spaces, one for the transport and another for the application. And now, we are starting to see the full 62-bit space actually being used; WebTransport draft-11 uses 0x52e4a40fa8db to 0x52e5ac983162.

This pull request switches to use int64_t called as quicly_error_t. The value space is divided in the following way:

range description
0 .. 0x2ff picotls
0xff00 .. 0xffff quicly internal error codes
0x30000 .. 0x4000_0000_0002_ffff QUIC application error codes
0x4000_0000_0003_0000 .. 0x8000_0000_0002_ffff QUIC transport error codes

This change affects applications, in sense that the type used to communicate error codes between quicly and applications are changed.

However, the lower range of application error codes are unchanged. Therefore, applications that only use tiny error codes can continue using int to store them.

Applications should continue using macros (e.g, QUICLY_ERROR_IS_QUIC_APPLICATION(e), QUICLY_ERROR_GET_ERROR_CODE(e), QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(e)) to convert between the coalesced error code space (i.e., formerly int, now quicly_error_t).

Closes #601.

@kazuho kazuho merged commit fc5beb1 into master Jan 12, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support 62-bit error codes
1 participant