From ac2f62b239e21f4291f931dfee6e3ea7e3232c24 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sat, 19 Nov 2016 01:49:54 +0100 Subject: [PATCH] reduce memory footprint in kcp --- transport/internet/kcp/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/internet/kcp/config.go b/transport/internet/kcp/config.go index 23926150..4d38b7b8 100644 --- a/transport/internet/kcp/config.go +++ b/transport/internet/kcp/config.go @@ -73,7 +73,7 @@ func (this *Config) GetSendingInFlightSize() uint32 { } func (this *Config) GetSendingBufferSize() uint32 { - return this.GetSendingInFlightSize() + this.WriteBuffer.GetSize()/this.Mtu.GetValue() + return this.WriteBuffer.GetSize() / this.Mtu.GetValue() } func (this *Config) GetReceivingInFlightSize() uint32 { @@ -85,7 +85,7 @@ func (this *Config) GetReceivingInFlightSize() uint32 { } func (this *Config) GetReceivingBufferSize() uint32 { - return this.GetReceivingInFlightSize() + this.ReadBuffer.GetSize()/this.Mtu.GetValue() + return this.ReadBuffer.GetSize() / this.Mtu.GetValue() } func init() {