mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-01 01:13:08 +00:00
Add maxReuseTimes
This commit is contained in:
@@ -121,6 +121,12 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
|
||||
|
||||
if h.senderSettings != nil && h.senderSettings.MultiplexSettings != nil {
|
||||
if config := h.senderSettings.MultiplexSettings; config.Enabled {
|
||||
// MaxReuseTimes use 60000 as default, and it also means the upper limit of MaxReuseTimes
|
||||
// In mux cool spec, connection ID is 2 bytes, so physical limit is 65535, bu we reserve some IDs for future use
|
||||
MaxReuseTimes := uint32(60000)
|
||||
if config.MaxReuseTimes != 0 && config.MaxReuseTimes < 60000 {
|
||||
MaxReuseTimes = uint32(config.MaxReuseTimes)
|
||||
}
|
||||
if config.Concurrency < 0 {
|
||||
h.mux = &mux.ClientManager{Enabled: false}
|
||||
}
|
||||
@@ -136,7 +142,7 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
|
||||
Dialer: h,
|
||||
Strategy: mux.ClientStrategy{
|
||||
MaxConcurrency: uint32(config.Concurrency),
|
||||
MaxConnection: 128,
|
||||
MaxReuseTimes: MaxReuseTimes,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -157,7 +163,7 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
|
||||
Dialer: h,
|
||||
Strategy: mux.ClientStrategy{
|
||||
MaxConcurrency: uint32(config.XudpConcurrency),
|
||||
MaxConnection: 128,
|
||||
MaxReuseTimes: 128,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user