Skip to content

http: couple fetch() receive backpressure to JS body consumption (h1/h2/h3)#29831

Open
robobun wants to merge 46 commits into
mainfrom
farm/0a9cea98/h2-window-update-backpressure
Open

http: couple fetch() receive backpressure to JS body consumption (h1/h2/h3)#29831
robobun wants to merge 46 commits into
mainfrom
farm/0a9cea98/h2-window-update-backpressure

test(h3): settle() holds for two consecutive 100ms gaps

77a98f2
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 2, 2026 in 43m 30s

Code review found 1 important issue

Found 4 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/http.zig:2291-2308 H1 Content-Encoding expansion accumulates permanent outstanding_body_bytes floor

Annotations

Check failure on line 2308 in src/http.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

H1 Content-Encoding expansion accumulates permanent outstanding_body_bytes floor

Same currency-mismatch class as the chunked-framing floor fixed in 66aab38, but in the Content-Encoding dimension: `maybePauseReceive` now counts the `total_body_received` delta (pre-decompression wire bytes — http.zig:2715 increments by `remainder.len` into `compressed_body`), while `consumeResponseBody` subtracts the post-decompression count that `didDrain` reports from `body_out_str`. The `-|= @min(...)` clamp only handles decompressed > compressed; when a Content-Encoding *expands* incompres