1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-21 16:56:27 -05:00

allow capacity = 0

This commit is contained in:
v2ray 2016-07-04 13:31:21 +02:00
parent d5cb2e88c9
commit 6a1054a0f3
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -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