mirror of https://github.com/v2ray/v2ray-core
allow capacity = 0
parent
d5cb2e88c9
commit
6a1054a0f3
|
@ -38,20 +38,10 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
|||
this.Tti = tti
|
||||
}
|
||||
if jsonConfig.UpCap != nil {
|
||||
upCap := *jsonConfig.UpCap
|
||||
if upCap == 0 {
|
||||
log.Error("KCP|Config: Invalid uplink capacity: ", upCap)
|
||||
return common.ErrBadConfiguration
|
||||
}
|
||||
this.UplinkCapacity = upCap
|
||||
this.UplinkCapacity = *jsonConfig.UpCap
|
||||
}
|
||||
if jsonConfig.DownCap != nil {
|
||||
downCap := *jsonConfig.DownCap
|
||||
if downCap == 0 {
|
||||
log.Error("KCP|Config: Invalid downlink capacity: ", downCap)
|
||||
return common.ErrBadConfiguration
|
||||
}
|
||||
this.DownlinkCapacity = downCap
|
||||
this.DownlinkCapacity = *jsonConfig.DownCap
|
||||
}
|
||||
if jsonConfig.Congestion != nil {
|
||||
this.Congestion = *jsonConfig.Congestion
|
||||
|
|
Loading…
Reference in New Issue