Add WebTransport over HTTP/3 draft-17 settings and error codes. QUICHE currently supports WebTransport over HTTP/3 up to draft-07. Updating to draft-17 requires the `SETTINGS_WT_ENABLED` setting identifier and the dedicated WebTransport HTTP/3 wire error codes. Add `SETTINGS_WT_ENABLED_DRAFT17` (`0x20b8933b`) to `Http3AndQpackSettingsIdentifiers`, and add `QuicWebTransportHttp3ErrorCode` with a `QuicResetStreamError::FromIetf` overload. Existing wire mappings for `QUIC_STREAM_WEBTRANSPORT_SESSION_GONE` and `QUIC_STREAM_WEBTRANSPORT_BUFFERED_STREAMS_LIMIT_EXCEEDED` remain unchanged so this commit introduces no behavioral change. PiperOrigin-RevId: 1027983931
diff --git a/quiche/quic/core/http/http_constants.cc b/quiche/quic/core/http/http_constants.cc index eb43a2f..117e133 100644 --- a/quiche/quic/core/http/http_constants.cc +++ b/quiche/quic/core/http/http_constants.cc
@@ -23,6 +23,7 @@ RETURN_STRING_LITERAL(SETTINGS_H3_DATAGRAM); RETURN_STRING_LITERAL(SETTINGS_WEBTRANS_DRAFT00); RETURN_STRING_LITERAL(SETTINGS_WEBTRANS_MAX_SESSIONS_DRAFT07); + RETURN_STRING_LITERAL(SETTINGS_WT_ENABLED_DRAFT17); RETURN_STRING_LITERAL(SETTINGS_ENABLE_CONNECT_PROTOCOL); RETURN_STRING_LITERAL(SETTINGS_ENABLE_METADATA); }
diff --git a/quiche/quic/core/http/http_constants.h b/quiche/quic/core/http/http_constants.h index 21ecf26..7e96252 100644 --- a/quiche/quic/core/http/http_constants.h +++ b/quiche/quic/core/http/http_constants.h
@@ -43,6 +43,8 @@ // draft-ietf-webtrans-http3 SETTINGS_WEBTRANS_DRAFT00 = 0x2b603742, SETTINGS_WEBTRANS_MAX_SESSIONS_DRAFT07 = 0xc671706a, + // draft-ietf-webtrans-http3-17. + SETTINGS_WT_ENABLED_DRAFT17 = 0x20b8933b, // draft-ietf-httpbis-h3-websockets SETTINGS_ENABLE_CONNECT_PROTOCOL = 0x08, SETTINGS_ENABLE_METADATA = 0x4d44,
diff --git a/quiche/quic/core/quic_error_codes.cc b/quiche/quic/core/quic_error_codes.cc index 5f19637..6ea8a74 100644 --- a/quiche/quic/core/quic_error_codes.cc +++ b/quiche/quic/core/quic_error_codes.cc
@@ -1016,6 +1016,12 @@ return FromIetf(static_cast<uint64_t>(code)); } +// static +QuicResetStreamError QuicResetStreamError::FromIetf( + QuicWebTransportHttp3ErrorCode code) { + return FromIetf(static_cast<uint64_t>(code)); +} + #undef RETURN_STRING_LITERAL // undef for jumbo builds } // namespace quic
diff --git a/quiche/quic/core/quic_error_codes.h b/quiche/quic/core/quic_error_codes.h index d3b00ce..2aa0160 100644 --- a/quiche/quic/core/quic_error_codes.h +++ b/quiche/quic/core/quic_error_codes.h
@@ -689,6 +689,15 @@ DECODER_STREAM_ERROR = 0x202 }; +// Wire values for WebTransport over HTTP/3 errors. +// https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3 +enum class QuicWebTransportHttp3ErrorCode : uint64_t { + WT_ALPN_ERROR = 0x0817b3dd, + WT_SESSION_GONE = 0x170d7b68, + WT_REQUIREMENTS_NOT_MET = 0x212c0d48, + WT_BUFFERED_STREAM_REJECTED = 0x3994bd84, +}; + // Represents a reason for resetting a stream in both gQUIC and IETF error code // space. Both error codes have to be present. class QUICHE_EXPORT QuicResetStreamError { @@ -701,6 +710,7 @@ static QuicResetStreamError FromIetf(uint64_t code); static QuicResetStreamError FromIetf(QuicHttp3ErrorCode code); static QuicResetStreamError FromIetf(QuicHttpQpackErrorCode code); + static QuicResetStreamError FromIetf(QuicWebTransportHttp3ErrorCode code); // Constructs a QuicResetStreamError with no error. static QuicResetStreamError NoError() { return FromInternal(QUIC_STREAM_NO_ERROR);
diff --git a/quiche/quic/core/quic_error_codes_test.cc b/quiche/quic/core/quic_error_codes_test.cc index 056f8ee..7ffcfb1 100644 --- a/quiche/quic/core/quic_error_codes_test.cc +++ b/quiche/quic/core/quic_error_codes_test.cc
@@ -139,6 +139,25 @@ } } +TEST_F(QuicRstErrorCodesTest, WebTransportHttp3ErrorCodes) { + EXPECT_EQ(QuicResetStreamError::FromIetf( + QuicWebTransportHttp3ErrorCode::WT_ALPN_ERROR) + .ietf_application_code(), + 0x0817b3ddu); + EXPECT_EQ(QuicResetStreamError::FromIetf( + QuicWebTransportHttp3ErrorCode::WT_SESSION_GONE) + .ietf_application_code(), + 0x170d7b68u); + EXPECT_EQ(QuicResetStreamError::FromIetf( + QuicWebTransportHttp3ErrorCode::WT_REQUIREMENTS_NOT_MET) + .ietf_application_code(), + 0x212c0d48u); + EXPECT_EQ(QuicResetStreamError::FromIetf( + QuicWebTransportHttp3ErrorCode::WT_BUFFERED_STREAM_REJECTED) + .ietf_application_code(), + 0x3994bd84u); +} + } // namespace } // namespace test } // namespace quic