1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

remove unnecessary constants

This commit is contained in:
v2ray 2016-07-02 11:31:15 +02:00
parent 94fb16fdfa
commit e1ce179b8e
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -10,16 +10,6 @@ import (
"github.com/v2ray/v2ray-core/common/log"
)
const (
IKCP_RTO_NDL = 30 // no delay min rto
IKCP_RTO_MIN = 100 // normal min rto
IKCP_RTO_DEF = 200
IKCP_RTO_MAX = 60000
IKCP_WND_SND = 32
IKCP_WND_RCV = 32
IKCP_INTERVAL = 100
)
func _itimediff(later, earlier uint32) int32 {
return (int32)(later - earlier)
}
@ -71,10 +61,10 @@ func NewKCP(conv uint16, output *AuthenticationWriter) *KCP {
kcp.conv = conv
kcp.snd_wnd = effectiveConfig.GetSendingWindowSize()
kcp.rcv_wnd = effectiveConfig.GetReceivingWindowSize()
kcp.rmt_wnd = IKCP_WND_RCV
kcp.rmt_wnd = 32
kcp.mss = output.Mtu() - DataSegmentOverhead
kcp.rx_rto = IKCP_RTO_DEF
kcp.interval = IKCP_INTERVAL
kcp.rx_rto = 100
kcp.interval = effectiveConfig.Tti
kcp.output = NewSegmentWriter(output)
kcp.rcv_buf = NewReceivingWindow(effectiveConfig.GetReceivingWindowSize())
kcp.snd_queue = NewSendingQueue(effectiveConfig.GetSendingQueueSize())
@ -185,8 +175,8 @@ func (kcp *KCP) update_ack(rtt int32) {
rto = kcp.rx_srtt + kcp.interval
}
if rto > IKCP_RTO_MAX {
rto = IKCP_RTO_MAX
if rto > 10000 {
rto = 10000
}
kcp.rx_rto = rto * 3 / 2
}