refactor(tuic): unify wind-tuiche into wind-tuic over the wind-quic abstraction#21
Merged
Conversation
…bstraction
The TUIC server is now written once, generic over wind_quic::QuicConnection, and both the quinn and quiche (tokio-quiche) backends run that single implementation. This deletes wind-tuiche entirely, including its ~993-line bespoke sans-IO driver, which is replaced by the shared server core over the wind-quic bridge.
Generic protocol core (wind-tuic/src): server/ (serve_connection<C> + handlers + UDP session manager), proto/ (ClientProtoExt<C>, UdpStream<C>, encode_and_send_uni<C>; relays via tokio::io::join + copy_io), client/ (ClientTaskExt<C>).
Backends are thin providers preserving the public type names: wind_tuic::quinn::{TuicInbound, TuicOutbound, ...} keep unchanged signatures (wind/tuic-client/wind-test compile untouched); wind_tuic::quiche::{TuicheInbound(Builder), TuicheOutbound(Builder), CertStore, ConnectionOpts, ...} mirror the former wind-tuiche surface.
Supporting changes: wind-quic gains quiche cert hot-reload (CertStore moved in; bind_server takes an optional store). wind-core::AbstractTcpStream drops its vestigial Sync bound (relay streams are only moved into tasks, so Send suffices; quiche stream halves are PollSender/mpsc-backed and not Sync). Consumers repointed: tuic-server and tuic-tests now use wind_tuic::quiche + the wind-tuic/quiche feature.
The quiche client remains a config-only stub (as in wind-tuiche); no test exercises a quiche client and the quinn client is the functional path. Verified: full workspace builds; quinn regression (wind-test 14, integration 7, protocol 14) and quiche e2e (integration, cert-reload, 0-RTT) all pass; clippy -D warnings clean on changed crates; nightly fmt clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Folds the
wind-tuiche(tokio-quiche) crate intowind-tuic, writing the TUIC server once generic overwind_quic::QuicConnection. Both the quinn and quiche backends now run that single implementation, so the two engines no longer carry parallel copies of the TUIC protocol logic.This is the follow-up to #20 (the
wind-quicabstraction), realizing its purpose:wind-tuicheis deleted, including its ~993-line bespoke sans-IOdriver.rs, which is replaced by the shared server core driven over thewind-quicbridge.Structure
Generic protocol core (
wind-tuic/src/):server/—serve_connection<C: QuicConnection>+ the auth handshake, the three accept loops (datagram/uni/bi), command dispatch, and the per-association UDP session manager. One implementation, shared by both backends.proto/—ClientProtoExt<C>,UdpStream<C>,encode_and_send_uni<C>. TCP relays usetokio::io::join(recv, send)+wind_core::io::copy_io(replacing the quinn-specificQuinnCompat).client/— genericClientTaskExt<C>.Backends are thin connection providers, preserving the public type names so consumer churn is just import paths:
wind_tuic::quinn::{TuicInbound, TuicInboundOpts, TuicOutbound, TuicOutboundOpts, …}— unchanged signatures;wind,tuic-client, andwind-testcompile untouched. Endpoint/handshake stays here; the per-connection body delegates to the shared core viaQuinnConnection.wind_tuic::quiche::{TuicheInbound(Builder), TuicheOutbound(Builder), CertStore, ConnectionOpts, CongestionControl, UdpRelayMode}— mirrors the formerwind-tuichesurface, running the same core viaQuicheConnection.Supporting changes
CertStore/CertReloadHook(boring-based, pure QUIC-TLS infra) moved in from wind-tuiche;wind_quic::quiche::bind_servertakes an optional&CertStorethat installs the per-handshakeConnectionHook.AbstractTcpStreamdrops its vestigialSyncbound. Relay streams are only ever moved into a spawned task (Sendsuffices, notSync), and the quiche backend's stream halves arePollSender/mpsc-backed and therefore!Sync. Confirmed no consumer relied onSync.tuic-server(quichefeature →wind-tuic/quiche;use wind_tuiche::…→use wind_tuic::quiche::…; dropped thewind_tuichelog target) andtuic-tests(64-bitwind-tuichedep →wind-tuic/quichefeature;quiche_cert_reload.rsimport).crates/wind-tuichedeleted.Scope note
The quiche client stays a config-only stub, exactly as in
wind-tuiche. No test exercises a quiche client (the quiche e2e tests use the quinn client against the quiche server), and the quinn client is the functional path — so making it "functional for free" would ship untested networking. Deferred. The server unification, which is where the duplication actually lived, is complete.Verification
wind-tuicwithquinn/quiche/ both / quiche-only, plus the full workspace.wind-test14/14,tuic-testsintegration 7/7, protocol 14/14.quiche_integration(TCP+UDP relay),quiche_cert_reload(hot-reload viawind_tuic::quiche),quiche_zero_rtt— all pass against the new server.cargo clippy -D warningsclean on every changed crate; nightlycargo fmt --checkclean.Reviewer notes
cargo clippy --workspace --all-targetssurfaces 3 lints inwind-testtest helpers (socks5.rs,tuic.rs) — these are pre-existing onmainin files this PR does not touch.🤖 Generated with Claude Code