From 6a1054a0f3b1b9803daa8e4103355fb2a1afa97a Mon Sep 17 00:00:00 2001 From: v2ray Date: Mon, 4 Jul 2016 13:31:21 +0200 Subject: [PATCH] allow capacity = 0 --- transport/internet/kcp/config_json.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/transport/internet/kcp/config_json.go b/transport/internet/kcp/config_json.go index b476112a..4e3f1425 100644 --- a/transport/internet/kcp/config_json.go +++ b/transport/internet/kcp/config_json.go @@ -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