Skip to content

Fix interrupt_exist_connections not working for Selector outbound#4005

Open
icepigeon-dev wants to merge 1 commit intoSagerNet:testingfrom
icepigeon-dev:fix/selector-interrupt-exist-connections
Open

Fix interrupt_exist_connections not working for Selector outbound#4005
icepigeon-dev wants to merge 1 commit intoSagerNet:testingfrom
icepigeon-dev:fix/selector-interrupt-exist-connections

Conversation

@icepigeon-dev
Copy link
Copy Markdown

Fixes #2625

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.

Tested by building and running the binary on macOS with a real configuration — selector outbound switch now properly interrupts existing connections.

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.
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.11.3 版本 "interrupt_exist_connections": true 无效?

1 participant