From 2e63b291915b2153969c2f356388b0c1d83a1298 Mon Sep 17 00:00:00 2001 From: v2ray Date: Mon, 27 Jun 2016 09:14:30 +0200 Subject: [PATCH] correct srtt boundary --- transport/internet/kcp/kcp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/internet/kcp/kcp.go b/transport/internet/kcp/kcp.go index ab4c0886..6ddcad4f 100644 --- a/transport/internet/kcp/kcp.go +++ b/transport/internet/kcp/kcp.go @@ -263,8 +263,8 @@ func (kcp *KCP) update_ack(rtt int32) { } kcp.rx_rttvar = (3*kcp.rx_rttvar + uint32(delta)) / 4 kcp.rx_srtt = (7*kcp.rx_srtt + uint32(rtt)) / 8 - if kcp.rx_srtt < 1 { - kcp.rx_srtt = 1 + if kcp.rx_srtt < kcp.interval { + kcp.rx_srtt = kcp.interval } } rto = kcp.rx_srtt + _imax_(kcp.interval, 4*kcp.rx_rttvar)