1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-16 17:38:45 -05:00

remove segment.rto

This commit is contained in:
v2ray 2016-06-25 17:34:07 +02:00
parent 15f190d268
commit 87e1d66ff0
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -104,7 +104,6 @@ type Segment struct {
sn uint32 sn uint32
una uint32 una uint32
resendts uint32 resendts uint32
rto uint32
fastack uint32 fastack uint32
xmit uint32 xmit uint32
data *alloc.Buffer data *alloc.Buffer
@ -614,7 +613,6 @@ func (kcp *KCP) flush() {
newseg.sn = kcp.snd_nxt newseg.sn = kcp.snd_nxt
newseg.una = kcp.rcv_nxt newseg.una = kcp.rcv_nxt
newseg.resendts = current newseg.resendts = current
newseg.rto = kcp.rx_rto
newseg.fastack = 0 newseg.fastack = 0
newseg.xmit = 0 newseg.xmit = 0
kcp.snd_buf = append(kcp.snd_buf, newseg) kcp.snd_buf = append(kcp.snd_buf, newseg)
@ -635,20 +633,18 @@ func (kcp *KCP) flush() {
if segment.xmit == 0 { if segment.xmit == 0 {
needsend = true needsend = true
segment.xmit++ segment.xmit++
segment.rto = kcp.rx_rto segment.resendts = current + kcp.rx_rto + kcp.interval
segment.resendts = current + segment.rto + kcp.interval
} else if _itimediff(current, segment.resendts) >= 0 { } else if _itimediff(current, segment.resendts) >= 0 {
needsend = true needsend = true
segment.xmit++ segment.xmit++
kcp.xmit++ kcp.xmit++
segment.rto += kcp.rx_rto segment.resendts = current + kcp.rx_rto + kcp.interval
segment.resendts = current + segment.rto + kcp.interval
//lost = true //lost = true
} else if segment.fastack >= resent { } else if segment.fastack >= resent {
needsend = true needsend = true
segment.xmit++ segment.xmit++
segment.fastack = 0 segment.fastack = 0
segment.resendts = current + segment.rto + kcp.interval segment.resendts = current + kcp.rx_rto + kcp.interval
change++ change++
} }