From e72f8a26c8b96ae75f46ff6b2c7e4c6f5bc14ce2 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 13 Nov 2016 22:29:31 +0100 Subject: [PATCH] min timeout --- transport/internet/kcp/receiving.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/transport/internet/kcp/receiving.go b/transport/internet/kcp/receiving.go index c43187231..2469063f1 100644 --- a/transport/internet/kcp/receiving.go +++ b/transport/internet/kcp/receiving.go @@ -102,7 +102,11 @@ func (this *AckList) Flush(current uint32, rto uint32) { if this.nextFlush[i] <= current { seg.PutNumber(this.numbers[i]) seg.PutTimestamp(this.timestamps[i]) - this.nextFlush[i] = current + rto/4 + timeout := rto / 4 + if timeout < 20 { + timeout = 20 + } + this.nextFlush[i] = current + timeout } } if seg.Count > 0 {