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 · May be fixed by #211
Open

Wrong model for stream error codes #182

MOZGIII opened this issue May 9, 2024 · 0 comments · May be fixed by #211
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

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
@BiagioFesta BiagioFesta added the good first issue Good for newcomers label Aug 9, 2024
barafael added a commit to barafael/wtransport that referenced this issue Sep 3, 2024
barafael added a commit to barafael/wtransport that referenced this issue Sep 3, 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 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants