wwhtrbbtt / TrackMe

https://tls.peet.ws
GNU General Public License v3.0
208 stars 32 forks source link

Fix weight increment in HEADERS and PRIORITY frames #1

Closed saucesteals closed 2 years ago

saucesteals commented 2 years ago

Priority Frame: Section 6.3 Headers Frame: Section 6.3

Both sections mention the following:

Weight: An unsigned 8-bit integer representing a priority weight for the stream (see Section 5.3). Add one to the value to obtain a weight between 1 and 256. This field is only present if the PRIORITY flag is set.

The weight from both frames is not converted from a uint8 (to make space for 256) before incrementing, which results in it overflowing to 0.

Moving the existing int conversion to the uint8 value before incrementing solves this.

wwhtrbbtt commented 2 years ago

Thanks a lot! Sorry for responding so late