never keep track of more than 500 ACK ranges

This is achieved by deleting the oldest ACK ranges when receiving a
packet that creates a new ACK range such that this limit is exceeded.
This commit is contained in:
Marten Seemann 2019-07-30 11:59:33 +07:00
parent 320d4a868e
commit 475ba63164
4 changed files with 30 additions and 43 deletions

View file

@ -59,19 +59,6 @@ var _ = Describe("Received Packet Tracker", func() {
Expect(tracker.largestObserved).To(Equal(protocol.PacketNumber(5)))
Expect(tracker.largestObservedReceivedTime).To(Equal(timestamp))
})
It("passes on errors from receivedPacketHistory", func() {
var err error
for i := protocol.PacketNumber(0); i < 5*protocol.MaxTrackedReceivedAckRanges; i++ {
err = tracker.ReceivedPacket(2*i+1, time.Time{}, true)
// this will eventually return an error
// details about when exactly the receivedPacketHistory errors are tested there
if err != nil {
break
}
}
Expect(err).To(MatchError(errTooManyOutstandingReceivedAckRanges))
})
})
Context("ACKs", func() {