|
@@ -315,14 +315,16 @@ func (w *SendingWorker) Flush(current uint32) {
|
|
|
return
|
|
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() {
|
|
if !w.window.IsEmpty() {
|
|
|
w.window.Flush(current, w.conn.roundTrip.Timeout(), cwnd)
|
|
w.window.Flush(current, w.conn.roundTrip.Timeout(), cwnd)
|
|
|
w.firstUnacknowledgedUpdated = false
|
|
w.firstUnacknowledgedUpdated = false
|