mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-01 01:44:15 +00:00
SplitHTTP client: Fix xmux config deserialization (#3827)
This commit is contained in:
parent
a35d5719f4
commit
f406b2dee0
3 changed files with 24 additions and 24 deletions
|
@ -235,10 +235,10 @@ type SplitHTTPConfig struct {
|
|||
}
|
||||
|
||||
type Xmux struct {
|
||||
maxConnections *Int32Range `json:"maxConnections"`
|
||||
maxConcurrency *Int32Range `json:"maxConcurrency"`
|
||||
cMaxReuseTimes *Int32Range `json:"cMaxReuseTimes"`
|
||||
cMaxLifetimeMs *Int32Range `json:"cMaxLifetimeMs"`
|
||||
MaxConcurrency *Int32Range `json:"maxConcurrency"`
|
||||
MaxConnections *Int32Range `json:"maxConnections"`
|
||||
CMaxReuseTimes *Int32Range `json:"cMaxReuseTimes"`
|
||||
CMaxLifetimeMs *Int32Range `json:"cMaxLifetimeMs"`
|
||||
}
|
||||
|
||||
func splithttpNewRandRangeConfig(input *Int32Range) *splithttp.RandRangeConfig {
|
||||
|
@ -263,16 +263,16 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
|||
c.Host = c.Headers["Host"]
|
||||
}
|
||||
|
||||
if c.Xmux.maxConnections != nil && c.Xmux.maxConcurrency != nil {
|
||||
if c.Xmux.MaxConnections != nil && c.Xmux.MaxConcurrency != nil {
|
||||
return nil, errors.New("maxConnections cannot be specified together with maxConcurrency")
|
||||
}
|
||||
|
||||
// Multiplexing config
|
||||
muxProtobuf := splithttp.Multiplexing{
|
||||
MaxConnections: splithttpNewRandRangeConfig(c.Xmux.maxConnections),
|
||||
MaxConcurrency: splithttpNewRandRangeConfig(c.Xmux.maxConcurrency),
|
||||
CMaxReuseTimes: splithttpNewRandRangeConfig(c.Xmux.cMaxReuseTimes),
|
||||
CMaxLifetimeMs: splithttpNewRandRangeConfig(c.Xmux.cMaxLifetimeMs),
|
||||
MaxConcurrency: splithttpNewRandRangeConfig(c.Xmux.MaxConcurrency),
|
||||
MaxConnections: splithttpNewRandRangeConfig(c.Xmux.MaxConnections),
|
||||
CMaxReuseTimes: splithttpNewRandRangeConfig(c.Xmux.CMaxReuseTimes),
|
||||
CMaxLifetimeMs: splithttpNewRandRangeConfig(c.Xmux.CMaxLifetimeMs),
|
||||
}
|
||||
|
||||
config := &splithttp.Config{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue