mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-30 21:26:33 -05:00
fix mkcp sending window
This commit is contained in:
parent
16fe0b03f6
commit
1a652933d9
@ -315,14 +315,16 @@ func (w *SendingWorker) Flush(current uint32) {
|
||||
return
|
||||
}
|
||||
|
||||
cwnd := w.firstUnacknowledged + w.conn.Config.GetSendingInFlightSize()
|
||||
if cwnd > w.remoteNextNumber {
|
||||
cwnd = w.remoteNextNumber
|
||||
cwnd := w.conn.Config.GetSendingInFlightSize()
|
||||
if cwnd > w.remoteNextNumber-w.firstUnacknowledged {
|
||||
cwnd = w.remoteNextNumber - w.firstUnacknowledged
|
||||
}
|
||||
if w.conn.Config.Congestion && cwnd > w.firstUnacknowledged+w.controlWindow {
|
||||
cwnd = w.firstUnacknowledged + w.controlWindow
|
||||
if w.conn.Config.Congestion && cwnd > w.controlWindow {
|
||||
cwnd = w.controlWindow
|
||||
}
|
||||
|
||||
cwnd *= 20 // magic
|
||||
|
||||
if !w.window.IsEmpty() {
|
||||
w.window.Flush(current, w.conn.roundTrip.Timeout(), cwnd)
|
||||
w.firstUnacknowledgedUpdated = false
|
||||
|
Loading…
Reference in New Issue
Block a user