mirror of https://github.com/v2ray/v2ray-core
refine rto settings
parent
52c6b9b60b
commit
27b8715b63
|
@ -256,7 +256,7 @@ func (kcp *KCP) update_ack(rtt int32) {
|
||||||
if rto > IKCP_RTO_MAX {
|
if rto > IKCP_RTO_MAX {
|
||||||
rto = IKCP_RTO_MAX
|
rto = IKCP_RTO_MAX
|
||||||
}
|
}
|
||||||
kcp.rx_rto = rto
|
kcp.rx_rto = rto * 3 / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
func (kcp *KCP) shrink_buf() {
|
func (kcp *KCP) shrink_buf() {
|
||||||
|
@ -510,18 +510,18 @@ func (kcp *KCP) flush() {
|
||||||
if segment.xmit == 0 {
|
if segment.xmit == 0 {
|
||||||
needsend = true
|
needsend = true
|
||||||
segment.xmit++
|
segment.xmit++
|
||||||
segment.resendts = current + (kcp.rx_rto * 3 / 2) + kcp.interval
|
segment.resendts = current + kcp.rx_rto
|
||||||
} 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.resendts = current + (kcp.rx_rto * 3 / 2) + kcp.interval
|
segment.resendts = current + kcp.rx_rto
|
||||||
//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 + (kcp.rx_rto * 3 / 2) + kcp.interval
|
segment.resendts = current + kcp.rx_rto
|
||||||
change++
|
change++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue