forked from quic-go/quic-go
fix pacing rate
The pacing rate needs to be calculated for the next packet to be sent, not for the next byte to be sent.
This commit is contained in:
@@ -89,7 +89,7 @@ func (c *cubicSender) TimeUntilSend(bytesInFlight protocol.ByteCount) time.Durat
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delay := c.rttStats.SmoothedRTT() / time.Duration(2*c.GetCongestionWindow())
|
delay := c.rttStats.SmoothedRTT() * time.Duration(protocol.DefaultTCPMSS) / time.Duration(2*c.GetCongestionWindow())
|
||||||
if !c.InSlowStart() { // adjust delay, such that it's 1.25*cwd/rtt
|
if !c.InSlowStart() { // adjust delay, such that it's 1.25*cwd/rtt
|
||||||
delay = delay * 8 / 5
|
delay = delay * 8 / 5
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user