fix: set default tun udp timeout to 5 minutes

This commit is contained in:
gVisor bot 2022-10-10 22:10:36 +08:00
parent 5574d8e688
commit 53afe73875
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"errors"
"net"
"sync"
"time"
"github.com/Dreamacro/clash/adapter/inbound"
C "github.com/Dreamacro/clash/constant"
@ -19,6 +20,8 @@ import (
"github.com/sagernet/sing/common/uot"
)
const UDPTimeout = 5 * time.Minute
type ListenerHandler struct {
TcpIn chan<- C.ConnContext
UdpIn chan<- *inbound.PacketAdapter

View File

@ -78,7 +78,7 @@ func New(options config.Tun, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.P
if options.UDPTimeout != 0 {
udpTimeout = options.UDPTimeout
} else {
udpTimeout = int64(C.DefaultUDPTimeout.Seconds())
udpTimeout = int64(sing.UDPTimeout.Seconds())
}
includeUID := uidToRange(options.IncludeUID)
if len(options.IncludeUIDRange) > 0 {