Skip to content

[connect-udp] cap the size of the maximum capsule being buffered - #3754

Merged
kazuho merged 14 commits into
masterfrom
kazuho/bound-capsule-size
Oct 23, 2026
Merged

kazuho merged 14 commits into
masterfrom
kazuho/bound-capsule-size

Conversation

@kazuho

@kazuho kazuho commented Oct 23, 2026

Copy link
Copy Markdown
Member

No description provided.

kazuho and others added 14 commits June 11, 2026 10:45
The check compared the encoded incomplete capsule bytes against the Capsule Value size limit. The parser already rejects oversized Capsule Values after decoding Capsule Length, and this extra check could reject otherwise valid incomplete capsules due to the encoded Type and Length bytes.

Co-authored-by: Codex <[email protected]>
udp_write_stream is called after udp_connect has created self->sock. The function already asserts this invariant, so the self->sock == NULL branch cannot be reached under the write_req/proceed_req contract.

Co-authored-by: Codex <[email protected]>
udp_connect invokes write_req directly after creating the UDP socket to consume request bytes already buffered by the protocol layer. If capsule parsing rejects those bytes, report the failure through proceed_req so the protocol handler can close or reset the request stream.

Add H1 coverage that sends tunnel headers and an oversized capsule in one write, exercising the early-data path before normal request streaming resumes.

Co-authored-by: Codex <[email protected]>
Use an in-process nonblocking UDP socket as the origin and check after each oversized-capsule case that no datagram reached it. This makes failures point at the protocol path that leaked the datagram instead of relying on one aggregate origin-output assertion.

Co-authored-by: Codex <[email protected]>
Keep the UDP origin as a nonblocking socket in the test process and use a fixed UDP datagram capsule after the oversized unknown capsule. This removes the unused payload plumbing and echo-output checks while keeping per-case origin leak assertions.

Co-authored-by: Codex <[email protected]>
Run h2o-httpclient directly with stdout and stderr redirected to a temp file, then delay in Perl before writing the oversized capsule bytes to stdin. This removes the open3 helper while preserving coverage of the non-early streaming path.

Co-authored-by: Codex <[email protected]>
@kazuho
kazuho merged commit 4212ce1 into master Oct 23, 2026
10 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.

1 participant