Skip to content

Conversation

@ChrisSchinnerl
Copy link
Member

@ChrisSchinnerl ChrisSchinnerl commented Dec 15, 2025

Which then allows for wrapping a net.Conn in whatever middleware we deem necessary for monitoring or rate limiting it.
This is not quite as accurate as the wrapping we perform on TCP connections, but quic-go is so optimized that it uses RawConn for reads. Which we can't monitor or limit.

Fixes #377

@github-project-automation github-project-automation bot moved this to In Progress in Sia Dec 15, 2025
@ChrisSchinnerl ChrisSchinnerl force-pushed the chris/quic-middleware branch 3 times, most recently from f77a836 to 7639dbe Compare December 15, 2025 11:52
@ChrisSchinnerl ChrisSchinnerl marked this pull request as ready for review December 15, 2025 13:04
Copilot AI review requested due to automatic review settings December 15, 2025 13:04
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds middleware functionality to QUIC connections, enabling wrapping of net.Conn streams for monitoring or rate limiting purposes. It also includes an unrelated bug fix for a potential double-close scenario in the parallel syncer.

  • Added WithStreamMiddleware option for QUIC client to wrap dialed streams
  • Added WithServeStreamMiddleware option for QUIC server to wrap accepted streams
  • Refactored quic.Serve signature to use variadic options instead of direct logger parameter (breaking change)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rhp/v4/quic/quic.go Core implementation of stream middleware for both client and server QUIC transports, including options pattern for Serve function
rhp/v4/quic/quic_test.go Updated test to use new transport struct fields
rhp/v4/rpc_test.go Added comprehensive test for middleware functionality and updated existing test to use new logger option
testutil/host.go Updated ServeQUIC signature to accept variadic ServeOption instead of logger parameter
syncer/parallel_sync.go Fixed potential double-close of finishCh channel using sync.Once
.changeset/fix_double_close_of_finishch_in_parallelsync.md Changeset for syncer bug fix
.changeset/add_option_to_add_middleware_to_dialed_or_accepted_quic_streams.md Changeset for QUIC middleware feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@n8mgr n8mgr merged commit 92f8baf into master Dec 17, 2025
19 of 20 checks passed
@n8mgr n8mgr deleted the chris/quic-middleware branch December 17, 2025 16:19
@github-project-automation github-project-automation bot moved this from In Progress to Done in Sia Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Fix double close of channel in parallelSync

3 participants