Skip to content

Commit 824217c

Browse files
committed
Add limit check
1 parent c55beec commit 824217c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/proxyman/outbound/handler.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
114114

115115
if h.senderSettings != nil && h.senderSettings.MultiplexSettings != nil {
116116
if config := h.senderSettings.MultiplexSettings; config.Enabled {
117-
MaxReuseTimes := uint32(65535) // as many as possible
118-
if config.MaxReuseTimes != 0 {
117+
// MaxReuseTimes use 65535 as default, and it also means the upper limit of MaxReuseTimes
118+
// Because in mux cool spec, connection ID is 2 bytes
119+
MaxReuseTimes := uint32(65535)
120+
if config.MaxReuseTimes != 0 && config.MaxReuseTimes < 65535 {
119121
MaxReuseTimes = uint32(config.MaxReuseTimes)
120122
}
121123
if config.Concurrency < 0 {

0 commit comments

Comments
 (0)