Closed alexanderkjall closed 9 months ago
Thanks for the fix! My initial feeling was, should this even be using usize
? Does the spec say which size is always used?
I agree that it feels a bit strange with usize, but I don't have very much domain knowledge about this and thought that a good step forward was to document current behaviour.
I'll happily rework it or close it if there is a better way forward :)
Alright, I found where it's mentioned in the RFC 9204 4.1.1:
QPACK implementations MUST be able to decode integers up to and including 62 bits long.
So, I think prefix_int
should probably be changed to work with u64
s, not usize
s.
I started to look at it, and changing it to u64 have some effects through the codebase.
I'll make an attempt on resolving this and report back.
I made an attempt at changing the encode/decode functions to operate on u64 instead of usize.
I think there is a number of structs that should also be reviewed for what data types they are using, I looked at InsertCountIncrement
and section 4.4.3 of the RFC seems to indicate that it should be an u8 rather than an usize.
But I lack both the domain knowledge and enough free time to gain that domain knowledge for being comfortable with the quality of this PR, please see it as inspiration or work in progress rather than a finished thing.
That's fine, thanks for what you've done so far! (Looks like it needs a cargo fmt
run)
The unit tests are currently not working on 32-bit platforms: https://qa.debian.org/excuses.php?package=rust-h3
result without this patch: