From 72ee6436ebe711a2a7c851aa60b2c856625c3ae9 Mon Sep 17 00:00:00 2001 From: v2ray Date: Fri, 15 Jul 2016 23:18:18 +0200 Subject: [PATCH] more accurate of rtt calculation --- transport/internet/kcp/sending.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/internet/kcp/sending.go b/transport/internet/kcp/sending.go index 2a98e1bc7..88c296882 100644 --- a/transport/internet/kcp/sending.go +++ b/transport/internet/kcp/sending.go @@ -323,7 +323,7 @@ func (this *SendingWorker) ProcessSegment(current uint32, seg *AckSegment) { for i := 0; i < int(seg.Count); i++ { timestamp := seg.TimestampList[i] number := seg.NumberList[i] - if current-timestamp < 10000 { + if current-timestamp < 10000 && number-this.firstUnacknowledged <= 0x7FFFFFFF { this.conn.roundTrip.Update(current - timestamp) } this.ProcessAck(number)