forked from quic-go/quic-go
congestion: rename OnPacketLost to OnCongestionEvent
This commit is contained in:
@@ -188,7 +188,7 @@ func (c *cubicSender) OnPacketAcked(
|
||||
}
|
||||
}
|
||||
|
||||
func (c *cubicSender) OnPacketLost(packetNumber protocol.PacketNumber, lostBytes, priorInFlight protocol.ByteCount) {
|
||||
func (c *cubicSender) OnCongestionEvent(packetNumber protocol.PacketNumber, lostBytes, priorInFlight protocol.ByteCount) {
|
||||
// TCP NewReno (RFC6582) says that once a loss occurs, any losses in packets
|
||||
// already sent should be treated as a single loss event, since it's expected.
|
||||
if packetNumber <= c.largestSentAtLastCutback {
|
||||
|
||||
@@ -80,14 +80,14 @@ var _ = Describe("Cubic Sender", func() {
|
||||
LoseNPacketsLen := func(n int, packetLength protocol.ByteCount) {
|
||||
for i := 0; i < n; i++ {
|
||||
ackedPacketNumber++
|
||||
sender.OnPacketLost(ackedPacketNumber, packetLength, bytesInFlight)
|
||||
sender.OnCongestionEvent(ackedPacketNumber, packetLength, bytesInFlight)
|
||||
}
|
||||
bytesInFlight -= protocol.ByteCount(n) * packetLength
|
||||
}
|
||||
|
||||
// Does not increment acked_packet_number_.
|
||||
LosePacket := func(number protocol.PacketNumber) {
|
||||
sender.OnPacketLost(number, maxDatagramSize, bytesInFlight)
|
||||
sender.OnCongestionEvent(number, maxDatagramSize, bytesInFlight)
|
||||
bytesInFlight -= maxDatagramSize
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ type SendAlgorithm interface {
|
||||
CanSend(bytesInFlight protocol.ByteCount) bool
|
||||
MaybeExitSlowStart()
|
||||
OnPacketAcked(number protocol.PacketNumber, ackedBytes protocol.ByteCount, priorInFlight protocol.ByteCount, eventTime time.Time)
|
||||
OnPacketLost(number protocol.PacketNumber, lostBytes protocol.ByteCount, priorInFlight protocol.ByteCount)
|
||||
OnCongestionEvent(number protocol.PacketNumber, lostBytes protocol.ByteCount, priorInFlight protocol.ByteCount)
|
||||
OnRetransmissionTimeout(packetsRetransmitted bool)
|
||||
SetMaxDatagramSize(protocol.ByteCount)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user