Skip to content

fix(http2): preserve empty header continuation sequences - #28

Merged
hatoo merged 1 commit into
masterfrom
codex/fix-h2-empty-continuation-20261012
Oct 12, 2026
Merged

hatoo merged 1 commit into
masterfrom
codex/fix-h2-empty-continuation-20261012

Conversation

@hatoo

@hatoo hatoo commented Oct 12, 2026

Copy link
Copy Markdown
Owner

An HTTP/2 response can start with a HEADERS frame containing no HPACK bytes and finish in CONTINUATION frames. The client used a nonempty buffer as its continuation state, so it rejected these valid responses. The same gap allowed an interleaved DATA END_STREAM to count an invalid response as a success.

Track the unfinished field block with its existing stream ID, clear that state at END_HEADERS, and reject HEADERS on stream zero. Preserve the original END_STREAM flag and reuse the header buffer without adding connection fields or allocations. Regression tests cover empty, padding-only and priority-only fragments; empty continuations and trailers; every transport cut; wrong streams, interleaving and EOF; TCP/TLS request accounting and reconnects.

Validation:

  • Five new parser regressions and three worker regressions fail on the unchanged baseline and pass after the fix.
  • Debug, release, Rust 1.91 and musl: 460 unit tests and 62 integration tests pass per profile; two existing ignored tests remain. Formatting and Clippy pass.
  • Independent nghttp2 1.59.0: 481 valid transport splits accepted and 728 invalid interleaving splits rejected. hyper-h2 4.3.0 agrees on four fragment variants; its padding-only limitation was checked separately with nghttp2 and RFC 9113 §6.2.
  • Immutable release clients against fixed hfast, three alternating pairs per workload: 13,565,952 requests including warmups, zero errors. RPS paired medians: c1/p1 −5.13% (pairs −9.86%, −5.13%, −0.55%); c16/p64 −0.05% (−0.87%, +0.43%, −0.05%). WSL timing remains uncertain, particularly the adverse single-connection result. This PR makes no speedup or performance-equivalence claim.

HTTP/2 field-block sequencing rules. Required hosted CI includes debug/release tests and the existing Docker interoperability suite.

@hatoo
hatoo enabled auto-merge (squash) October 12, 2026 09:44
@hatoo
hatoo merged commit 3a21ba0 into master Oct 12, 2026
4 checks passed
@hatoo
hatoo deleted the codex/fix-h2-empty-continuation-20261012 branch October 12, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant