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

Wrong model for stream error codes #182

Open
MOZGIII opened this issue May 9, 2024 · 0 comments
Open

Wrong model for stream error codes #182

MOZGIII opened this issue May 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@MOZGIII
Copy link
Contributor

MOZGIII commented May 9, 2024

The stream error codes are modelled incorrectly.

Currently, wtransport just passes the error code numeric value (in fact, the same VarInt) through to the QUIC / HTTP3 layer.

However, this is not correct. WebTransport is supposed to apply the following conversion to the error codes:

fn webtransport_code_to_http_code(n: u32) -> wtransport::VarInt {
    let first: u64 = 0x52e4a40fa8db;
    let n: u64 = n.into();
    let val: u64 = first + n + (n / 0x1e);
    val.try_into().unwrap()
}

This is based on https://github.com/web-platform-tests/wpt/blob/master/webtransport/resources/webtransport-test-helpers.sub.js#L18 - which is based on https://ietf-wg-webtrans.github.io/draft-ietf-webtrans-http3/draft-ietf-webtrans-http3.html#section-4.3.

@BiagioFesta BiagioFesta self-assigned this May 9, 2024
@BiagioFesta BiagioFesta added the bug Something isn't working label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants