mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-05-13 13:57:05 +00:00
Fix stun test
This commit is contained in:
parent
3828b4f30e
commit
104c7ae24d
1 changed files with 5 additions and 0 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue