1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-03 06:30:42 +00:00

allow small capacity

This commit is contained in:
v2ray 2016-06-29 16:46:26 +02:00
parent 6e615c5863
commit af5a2ac0bc
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -14,11 +14,19 @@ func (this *Config) Apply() {
}
func (this *Config) GetSendingWindowSize() uint32 {
return this.UplinkCapacity * 1024 * 1024 / this.Mtu / (1000 / this.Tti)
size := this.UplinkCapacity * 1024 * 1024 / this.Mtu / (1000 / this.Tti) / 2
if size == 0 {
size = 8
}
return size
}
func (this *Config) GetReceivingWindowSize() uint32 {
return this.DownlinkCapacity * 1024 * 1024 / this.Mtu / (1000 / this.Tti)
size := this.DownlinkCapacity * 1024 * 1024 / this.Mtu / (1000 / this.Tti) / 2
if size == 0 {
size = 8
}
return size
}
func DefaultConfig() Config {