From 87e1d66ff0978e58618e8fec60e73b0d1e495838 Mon Sep 17 00:00:00 2001 From: v2ray Date: Sat, 25 Jun 2016 17:34:07 +0200 Subject: [PATCH] remove segment.rto --- transport/internet/kcp/kcp.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/transport/internet/kcp/kcp.go b/transport/internet/kcp/kcp.go index 93ed7e48d..662245f4c 100644 --- a/transport/internet/kcp/kcp.go +++ b/transport/internet/kcp/kcp.go @@ -104,7 +104,6 @@ type Segment struct { sn uint32 una uint32 resendts uint32 - rto uint32 fastack uint32 xmit uint32 data *alloc.Buffer @@ -614,7 +613,6 @@ func (kcp *KCP) flush() { newseg.sn = kcp.snd_nxt newseg.una = kcp.rcv_nxt newseg.resendts = current - newseg.rto = kcp.rx_rto newseg.fastack = 0 newseg.xmit = 0 kcp.snd_buf = append(kcp.snd_buf, newseg) @@ -635,20 +633,18 @@ func (kcp *KCP) flush() { if segment.xmit == 0 { needsend = true segment.xmit++ - segment.rto = kcp.rx_rto - segment.resendts = current + segment.rto + kcp.interval + segment.resendts = current + kcp.rx_rto + kcp.interval } else if _itimediff(current, segment.resendts) >= 0 { needsend = true segment.xmit++ kcp.xmit++ - segment.rto += kcp.rx_rto - segment.resendts = current + segment.rto + kcp.interval + segment.resendts = current + kcp.rx_rto + kcp.interval //lost = true } else if segment.fastack >= resent { needsend = true segment.xmit++ segment.fastack = 0 - segment.resendts = current + segment.rto + kcp.interval + segment.resendts = current + kcp.rx_rto + kcp.interval change++ }