Skip to content

WebSocket client: reset inflater after Z_STREAM_END with context takeover - #34105

Merged
Jarred-Sumner merged 4 commits into
mainfrom
claude/farm/42140bc4/websocket-client-bfinal-reset
Jul 14, 2026
Merged

WebSocket client: reset inflater after Z_STREAM_END with context takeover#34105
Jarred-Sumner merged 4 commits into
mainfrom
claude/farm/42140bc4/websocket-client-bfinal-reset

test: use WEBSOCKET_GUID constant in BFINAL reset test

47fe4b6
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 14, 2026 in 14m 10s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/http_jsc/websocket_client/WebSocketDeflate.rs:182-185 Intra-message BFINAL: bytes after Z_STREAM_END within the same message are discarded

Annotations

Check notice on line 185 in src/http_jsc/websocket_client/WebSocketDeflate.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Intra-message BFINAL: bytes after Z_STREAM_END within the same message are discarded

Pre-existing / non-blocking: the loop still `break`s unconditionally on `StreamEnd`, so if a *single* message payload contains a BFINAL=1 block followed by a fresh DEFLATE stream (RFC 7692 §7.2.3.4/§7.2.3.5 permit per-fragment BFINAL flushing), the bytes remaining after `Z_STREAM_END` are discarded and that message is delivered truncated — the post-loop `reset()` only recovers the *next* message. A `self.decompress_stream.reset()` + `continue` (when `remaining` holds more than the appended trail