Fix interrupt_exist_connections not working for Selector outbound#4005
Open
icepigeon-dev wants to merge 1 commit intoSagerNet:testingfrom
Open
Fix interrupt_exist_connections not working for Selector outbound#4005icepigeon-dev wants to merge 1 commit intoSagerNet:testingfrom
icepigeon-dev wants to merge 1 commit intoSagerNet:testingfrom
Conversation
The Selector's `NewConnectionEx`/`NewPacketConnectionEx` delegated directly to the selected outbound, bypassing the Selector's `DialContext`/`ListenPacket` where connections are registered in the interrupt group. Connections were never tracked, so `Interrupt()` on outbound switch had nothing to close. Fix by routing through `ConnectionManager` with the Selector as the dialer, consistent with URLTest.
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.
Fixes #2625
The Selector's
NewConnectionEx/NewPacketConnectionExdelegated directly to the selected outbound, bypassing the Selector'sDialContext/ListenPacketwhere connections are registered in the interrupt group. Connections were never tracked, soInterrupt()on outbound switch had nothing to close.Fix by routing through
ConnectionManagerwith the Selector as the dialer, consistent with URLTest.Tested by building and running the binary on macOS with a real configuration — selector outbound switch now properly interrupts existing connections.