diff --git a/connection/connection.go b/connection/connection.go index f061672c..2a57229f 100644 --- a/connection/connection.go +++ b/connection/connection.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "math" "net/http" "strconv" "strings" @@ -19,6 +20,7 @@ const ( lbProbeUserAgentPrefix = "Mozilla/5.0 (compatible; Cloudflare-Traffic-Manager/1.0; +https://www.cloudflare.com/traffic-manager/;" LogFieldConnIndex = "connIndex" MaxGracePeriod = time.Minute * 3 + MaxConcurrentStreams = math.MaxUint32 ) var switchingProtocolText = fmt.Sprintf("%d %s", http.StatusSwitchingProtocols, http.StatusText(http.StatusSwitchingProtocols)) diff --git a/connection/http2.go b/connection/http2.go index 2e869890..cfe65f78 100644 --- a/connection/http2.go +++ b/connection/http2.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "math" "net" "net/http" "runtime/debug" @@ -60,7 +59,7 @@ func NewHTTP2Connection( return &HTTP2Connection{ conn: conn, server: &http2.Server{ - MaxConcurrentStreams: math.MaxUint32, + MaxConcurrentStreams: MaxConcurrentStreams, }, config: config, connOptions: connOptions, diff --git a/origin/tunnel.go b/origin/tunnel.go index 798c821c..190be47d 100644 --- a/origin/tunnel.go +++ b/origin/tunnel.go @@ -358,7 +358,6 @@ func serveTunnel( config, connOptions, controlStream, - connectedFuse, reconnectCh, gracefulShutdownC) @@ -509,15 +508,16 @@ func ServeQUIC( config *TunnelConfig, connOptions *tunnelpogs.ConnectionOptions, controlStreamHandler connection.ControlStreamHandler, - connectedFuse connection.ConnectedFuse, reconnectCh chan ReconnectSignal, gracefulShutdownC <-chan struct{}, ) (err error, recoverable bool) { tlsConfig := config.EdgeTLSConfigs[connection.QUIC] quicConfig := &quic.Config{ - HandshakeIdleTimeout: quicHandshakeIdleTimeout, - MaxIdleTimeout: quicMaxIdleTimeout, - KeepAlive: true, + HandshakeIdleTimeout: quicHandshakeIdleTimeout, + MaxIdleTimeout: quicMaxIdleTimeout, + MaxIncomingStreams: connection.MaxConcurrentStreams, + MaxIncomingUniStreams: connection.MaxConcurrentStreams, + KeepAlive: true, } for { select {