From 6776ec538f697dce3bf1c68392095fa1a4959479 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Tue, 17 Jan 2023 14:25:19 +0800 Subject: [PATCH] fix: tuic server's MaxIncomingStreams --- listener/tuic/server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/listener/tuic/server.go b/listener/tuic/server.go index 8b928637..724d7418 100644 --- a/listener/tuic/server.go +++ b/listener/tuic/server.go @@ -18,6 +18,8 @@ import ( "github.com/Dreamacro/clash/transport/tuic" ) +const ServerMaxIncomingStreams = (1 << 32) - 1 + type Listener struct { closed bool config LC.TuicServer @@ -47,8 +49,8 @@ func New(config LC.TuicServer, tcpIn chan<- C.ConnContext, udpIn chan<- C.Packet } quicConfig := &quic.Config{ MaxIdleTimeout: time.Duration(config.MaxIdleTime) * time.Millisecond, - MaxIncomingStreams: 1 >> 32, - MaxIncomingUniStreams: 1 >> 32, + MaxIncomingStreams: ServerMaxIncomingStreams, + MaxIncomingUniStreams: ServerMaxIncomingStreams, EnableDatagrams: true, } quicConfig.InitialStreamReceiveWindow = tuic.DefaultStreamReceiveWindow / 10