Fix stun test

This commit is contained in:
世界 2026-04-10 20:59:59 +08:00
parent 3828b4f30e
commit 104c7ae24d
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -9,6 +9,8 @@ import (
"net/netip"
"time"
"github.com/sagernet/sing/common/bufio"
"github.com/sagernet/sing/common/bufio/deadline"
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
@ -431,6 +433,9 @@ func Run(options Options) (*Result, error) {
defer func() {
_ = packetConn.Close()
}()
if deadline.NeedAdditionalReadDeadline(packetConn) {
packetConn = deadline.NewPacketConn(bufio.NewPacketConn(packetConn))
}
select {
case <-ctx.Done():