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.
Priority Frame: Section 6.3 Headers Frame: Section 6.3
Both sections mention the following:
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.