Skip to content

Conversation

@kixelated
Copy link
Collaborator

Summary

  • Add buffering for leftover bytes after CONNECT handshake (capsule data can arrive with HEADERS frame)
  • Refactor run_closed() to properly read HTTP/3 DATA frames and decode multiple capsules per frame
  • Handle GREASE capsules explicitly instead of implicitly in loop
  • More robust frame parsing with cursor-based approach

Details

Previously, the code assumed Capsule::read() would handle the HTTP/3 framing, but it only handles the capsule protocol layer. This fix properly:

  1. Reads HTTP/3 frames from the CONNECT stream
  2. Extracts DATA frame payloads
  3. Decodes potentially multiple capsules from each DATA frame
  4. Preserves leftover bytes from the CONNECT handshake that may contain capsule data

Dependencies

🤖 Generated with Claude Code

kixelated and others added 2 commits February 9, 2026 17:36
Changes:
- Remove loop in Capsule::decode() - now decodes single capsule instead of skipping GREASE
- Add explicit Grease variant to Capsule enum
- Fix GREASE detection per RFC 9297 Section 5.4 (0x29 * N + 0x17)
- Change Capsule::read() to return Option<Self> (returns None on clean EOF)
- Update web-transport-quinn to handle new API

This is foundational for properly handling HTTP/3 frames that may
contain multiple capsules or GREASE values.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes:
- Add buffering for leftover bytes after CONNECT handshake
  (capsule data can arrive with HEADERS frame)
- Refactor run_closed() to properly read HTTP/3 DATA frames
  and decode multiple capsules per frame
- Handle GREASE capsules explicitly
- More robust frame parsing with cursor-based approach

Previously, the code assumed Capsule::read() would handle the HTTP/3
framing, but it only handles capsule protocol. This fix properly
extracts DATA frames first, then decodes capsules from the payload.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Base automatically changed from fix-capsule-protocol to main February 10, 2026 01:58
@kixelated kixelated closed this Feb 10, 2026
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