mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
refine rto settings
This commit is contained in:
parent
52c6b9b60b
commit
27b8715b63
@ -256,7 +256,7 @@ func (kcp *KCP) update_ack(rtt int32) {
|
||||
if rto > IKCP_RTO_MAX {
|
||||
rto = IKCP_RTO_MAX
|
||||
}
|
||||
kcp.rx_rto = rto
|
||||
kcp.rx_rto = rto * 3 / 2
|
||||
}
|
||||
|
||||
func (kcp *KCP) shrink_buf() {
|
||||
@ -510,18 +510,18 @@ func (kcp *KCP) flush() {
|
||||
if segment.xmit == 0 {
|
||||
needsend = true
|
||||
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 {
|
||||
needsend = true
|
||||
segment.xmit++
|
||||
kcp.xmit++
|
||||
segment.resendts = current + (kcp.rx_rto * 3 / 2) + kcp.interval
|
||||
segment.resendts = current + kcp.rx_rto
|
||||
//lost = true
|
||||
} else if segment.fastack >= resent {
|
||||
needsend = true
|
||||
segment.xmit++
|
||||
segment.fastack = 0
|
||||
segment.resendts = current + (kcp.rx_rto * 3 / 2) + kcp.interval
|
||||
segment.resendts = current + kcp.rx_rto
|
||||
change++
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user