From 897521defdfeb610ec0d7608b4f11ed55780485a Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Wed, 16 Oct 2024 03:47:41 +0000 Subject: [PATCH] XMUX: Change to non-infinity-reuse default values (#3919) --- infra/conf/transport_internet.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index 838438a4..904505bf 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -243,7 +243,10 @@ type Xmux struct { func splithttpNewRandRangeConfig(input *Int32Range) *splithttp.RandRangeConfig { if input == nil { - return nil + return &splithttp.RandRangeConfig{ + From: 0, + To: 0, + } } return &splithttp.RandRangeConfig{ @@ -275,6 +278,16 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) { CMaxLifetimeMs: splithttpNewRandRangeConfig(c.Xmux.CMaxLifetimeMs), } + if muxProtobuf.MaxConcurrency.To == 0 && + muxProtobuf.MaxConnections.To == 0 && + muxProtobuf.CMaxReuseTimes.To == 0 && + muxProtobuf.CMaxLifetimeMs.To == 0 { + muxProtobuf.MaxConcurrency.From = 16 + muxProtobuf.MaxConcurrency.To = 32 + muxProtobuf.CMaxReuseTimes.From = 64 + muxProtobuf.CMaxReuseTimes.To = 128 + } + config := &splithttp.Config{ Path: c.Path, Host: c.Host,