sending window fix

pull/215/head
v2ray 2016-07-03 09:38:40 +02:00
parent ab2cef1c09
commit f8a614714c
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 2 additions and 2 deletions

View File

@ -291,10 +291,10 @@ func (kcp *KCP) flush() {
// calculate window size
cwnd := kcp.snd_una + kcp.snd_wnd
if cwnd < kcp.rmt_wnd {
if cwnd > kcp.rmt_wnd {
cwnd = kcp.rmt_wnd
}
if kcp.congestionControl && cwnd < kcp.snd_una+kcp.cwnd {
if kcp.congestionControl && cwnd > kcp.snd_una+kcp.cwnd {
cwnd = kcp.snd_una + kcp.cwnd
}