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
|
this.Tti = tti
|
||||||
}
|
}
|
||||||
if jsonConfig.UpCap != nil {
|
if jsonConfig.UpCap != nil {
|
||||||
upCap := *jsonConfig.UpCap
|
this.UplinkCapacity = *jsonConfig.UpCap
|
||||||
if upCap == 0 {
|
|
||||||
log.Error("KCP|Config: Invalid uplink capacity: ", upCap)
|
|
||||||
return common.ErrBadConfiguration
|
|
||||||
}
|
|
||||||
this.UplinkCapacity = upCap
|
|
||||||
}
|
}
|
||||||
if jsonConfig.DownCap != nil {
|
if jsonConfig.DownCap != nil {
|
||||||
downCap := *jsonConfig.DownCap
|
this.DownlinkCapacity = *jsonConfig.DownCap
|
||||||
if downCap == 0 {
|
|
||||||
log.Error("KCP|Config: Invalid downlink capacity: ", downCap)
|
|
||||||
return common.ErrBadConfiguration
|
|
||||||
}
|
|
||||||
this.DownlinkCapacity = downCap
|
|
||||||
}
|
}
|
||||||
if jsonConfig.Congestion != nil {
|
if jsonConfig.Congestion != nil {
|
||||||
this.Congestion = *jsonConfig.Congestion
|
this.Congestion = *jsonConfig.Congestion
|
||||||
|
|
Loading…
Reference in New Issue