Skip to content

Add WebTransport client sessions and validated server stream dispatch - #3

Open
xenorune wants to merge 4 commits into
runewarp/server-initiated-streamsfrom
runewarp/webtransport-client
Open

xenorune wants to merge 4 commits into
runewarp/server-initiated-streamsfrom
runewarp/webtransport-client

Conversation

@xenorune

@xenorune xenorune commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What

Add the client half of the WebTransport layer: negotiated Extended CONNECT sessions, exact-session validation of server-opened bidirectional streams, bounded dispatch, and session close/drain reception. Ordinary HTTP/3 request handles remain usable on the same connection.

The review fixes accept successful CONNECT responses with Content-Length or Transfer-Encoding, send the required draft02 offer, and ignore legacy response draft headers for later draft groups.

Why

runewarp/runewarp#255 needs server-opened WebTransport streams without a per-stream client round trip. This ports the client behavior from the carrier prototype into the real crate layout, including GET-before-CONNECT session IDs, bounded parsing, cancellation cleanup, response validation, and generic session caps.

RFC 9110 section 9.3.6 requires clients to ignore Content-Length and Transfer-Encoding on successful CONNECT. Draft02 section 6 requires its request offer. Later draft groups do not use the legacy response header for negotiation.

This PR stacks on runewarp/server-initiated-streams. The Server opener/lifecycle layer and final PATCHES.md inventory remain followup work. It does not change Runewarp or select the final integration pin.

How

A connection-scoped driver keeps the ordinary h3 driver and a request sender alive, classifies prefixes through bounded independent futures, and routes only exact CONNECT stream IDs into bounded per-session queues. Session handles reuse the adopted capsule reader and session state. CONNECT rejection, cancellation, unknown or invalid stream IDs, saturation, and owner drop explicitly abort streams. SETTINGS retain each draft's independent cap and normalize local wire advertisement before bilateral negotiation.

Successful CONNECT ignores HTTP framing fields without changing core H3 parsing or unrelated request behavior. Draft02 inserts a missing sec-webtransport-http3-draft02: 1, preserves a single supplied 1, and rejects other values or duplicates before opening CONNECT. Its response still requires exactly one sec-webtransport-http3-draft: draft02. Draft07/13/15 ignore all legacy response draft values, including duplicates. Non-success responses and unoffered application subprotocols still fail.

The README documents API usage and the draft 02/07/13/15 subset. Draft07 preserves the prototype's wire profile; full current-draft flow control, client unidirectional streams, datagram routing, and application subprotocol negotiation remain outside this client layer.

Validation after the fixes: 321 workspace tests pass with all features and with default features, including 26 client integration tests. The framing fix separately passed the all-features workspace suite with 318 tests before its commit. Regression tests reproduced the framing, missing-offer, and later-header failures before their fixes; removing duplicate-offer validation also makes its regression fail. Strict mock-peer tests require the draft02 offer, preserve valid supplied offers, and reject conflicting offers and duplicate draft02 replies. Formatting, strict library Clippy, strict client-test Clippy, the ordinary example exchange, and 43 native ARM64 h3spec cases pass with the existing five exclusions. All-target Clippy reports exactly the same 16 pre-existing warnings, including messages and source locations. No manifest, crate-name, lockfile, publishing, or CI changes.

Independent review found no blocking defects at pinned head 3631bc55b178f4f0e895847af44d39f4845ec397 and identified the two interoperability fixes above. Post-review-fix head is 72671cb409c4dd1846ac4050d8b4958d906c21bc. No second independent review or review/CI polling was performed; the parent owns orchestration.

🤖 Written by @dtcristo's agent (GPT-6.1-Sol, Claude Opus5.5)

dtcristo and others added 4 commits October 24, 2026 21:56
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
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.

2 participants