Repository navigation
Conversation
Problem: SETTINGS payload-size failures and HPACK decoder failures are collapsed into PROTOCOL_ERROR. Solution: preserve FRAME_SIZE_ERROR for SETTINGS size violations and COMPRESSION_ERROR for HPACK failures, including final truncated blocks and continuations. Keep existing semantic header errors and abuse limits unchanged. Validation: the raw-wire regression passes on the fix and fails on the original source. Covers malformed SETTINGS, nonempty ACK, bad HPACK indices, truncated HPACK, and CONTINUATION. Co-authored-by: Codex GPT-6.1 Sol <[email protected]>
Member
|
This is on purpose. Note what the RFC says:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: Malformed SETTINGS payload lengths are reported as
PROTOCOL_ERRORinstead of the requiredFRAME_SIZE_ERROR.Fix: Preserve the specific size-error classification when loading SETTINGS.
Example: A three-byte SETTINGS payload, or an ACK carrying a payload, now yields error code 6 instead of 1.
Impact: RFC 9113-compliant error reporting.
Existing client impact: These invalid frames already close the connection; only the error code changes. Valid SETTINGS and semantic validation are unchanged.
Problem: Invalid HPACK blocks are reported as
PROTOCOL_ERRORinstead ofCOMPRESSION_ERROR.Fix: Map HPACK decoder failures to
COMPRESSION_ERROR, including truncated final blocks and CONTINUATION frames.Example: Indexed header field 0 (
0x80) now yields error code 9 instead of 1.Impact: Correct connection-error classification for compression failures.
Existing client impact: Valid header blocks, stream-level semantic errors, incomplete nonfinal blocks, and abuse limits retain their behavior.
Validation: one raw-wire regression covers both SETTINGS cases, invalid/truncated HPACK, and CONTINUATION. It passes on the fix and fails immediately on the unmodified master source. Tested remotely with
cargo +nightly test --locked -p h2-tests --test codec_read malformed_settings_and_hpack_preserve_error_codes.Reference: https://www.rfc-editor.org/rfc/rfc9113.html (sections 6.5 and 4.3).