Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion h3/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,21 @@ impl From<&frame::Settings> for Settings {
max_field_section_size: settings
.get(frame::SettingId::MAX_HEADER_LIST_SIZE)
.unwrap_or(defaults.max_field_section_size),
// A peer signals WebTransport support with either the legacy
// draft-02 boolean or the RFC-track WT_MAX_SESSIONS (> 0 means
// supported); WebKit sends only the latter.
enable_webtransport: settings
.get(frame::SettingId::ENABLE_WEBTRANSPORT)
.map(|value| value != 0)
.or_else(|| {
settings
.get(frame::SettingId::WT_MAX_SESSIONS)
.map(|value| value != 0)
})
.unwrap_or(defaults.enable_webtransport),
max_webtransport_sessions: settings
.get(frame::SettingId::WEBTRANSPORT_MAX_SESSIONS)
.get(frame::SettingId::WT_MAX_SESSIONS)
.or_else(|| settings.get(frame::SettingId::WEBTRANSPORT_MAX_SESSIONS))
.unwrap_or(defaults.max_webtransport_sessions),
enable_datagram: settings
.get(frame::SettingId::H3_DATAGRAM)
Expand Down Expand Up @@ -129,6 +138,9 @@ impl TryFrom<Config> for frame::Settings {
frame::SettingId::WEBTRANSPORT_MAX_SESSIONS,
max_webtransport_sessions,
)?;
// Advertise the RFC-track codepoint alongside the legacy pair:
// Chrome accepts either dialect, WebKit requires this one.
settings.insert(frame::SettingId::WT_MAX_SESSIONS, max_webtransport_sessions)?;

Ok(settings)
}
Expand Down
4 changes: 4 additions & 0 deletions h3/src/proto/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ impl SettingId {
| SettingId::ENABLE_CONNECT_PROTOCOL
| SettingId::ENABLE_WEBTRANSPORT
| SettingId::WEBTRANSPORT_MAX_SESSIONS
| SettingId::WT_MAX_SESSIONS
| SettingId::H3_DATAGRAM,
)
}
Expand Down Expand Up @@ -455,6 +456,9 @@ setting_identifiers! {
H3_SETTING_ENABLE_DATAGRAM_CHROME_SPECIFIC= 0xFFD277,

WEBTRANSPORT_MAX_SESSIONS = 0x2b603743,
// RFC-track codepoint (draft-ietf-webtrans-http3 draft-07+); WebKit
// requires this one and ignores the legacy pair above.
WT_MAX_SESSIONS = 0xc671706a,
}

const SETTINGS_LEN: usize = 8;
Expand Down
Loading