Skip to content

Fix truncated concatenated zstd response bodies - #470

Merged
ducaale merged 2 commits into
ducaale:masterfrom
snowyukitty:fix-concatenated-zstd-frames
Jul 17, 2026
Merged

ducaale merged 2 commits into
ducaale:masterfrom
snowyukitty:fix-concatenated-zstd-frames

Conversation

@snowyukitty

@snowyukitty snowyukitty commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Responses using Content-Encoding: zstd can contain multiple concatenated frames. xh currently stops after the first one, silently truncating the response body. In #469 this cuts a JSON response at 65,536 bytes, leaving jq with incomplete input.

ruzstd::StreamingDecoder intentionally handles a single frame. This change keeps xh's lazy read behavior but drives a reusable FrameDecoder directly, advancing through standard and skippable frames without exposing an intermediate EOF. Incomplete following frames and truncated skippable payloads still surface as decode errors, and transport errors retain their existing context.

Closes #469.

@ducaale ducaale left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ducaale
ducaale merged commit a005bcb into ducaale:master Jul 17, 2026
19 of 20 checks passed
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.

Response stream truncated prematurely when using Zstd compression

2 participants