mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
Merge pull request #1333 from lucas-clemente/acks-for-delayed-packets
don't send an ACK when receiving a packet that wouldn't be acked
This commit is contained in:
commit
45d5acef14
2 changed files with 19 additions and 2 deletions
|
@ -159,7 +159,7 @@ var _ = Describe("receivedPacketHandler", func() {
|
|||
Expect(err).ToNot(HaveOccurred())
|
||||
err = handler.ReceivedPacket(13, time.Time{}, true)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
ack := handler.GetAckFrame() // ACK: 1 and 3, missing: 2
|
||||
ack := handler.GetAckFrame() // ACK: 1-11 and 13, missing: 12
|
||||
Expect(ack).ToNot(BeNil())
|
||||
Expect(ack.HasMissingRanges()).To(BeTrue())
|
||||
Expect(handler.ackQueued).To(BeFalse())
|
||||
|
@ -168,6 +168,23 @@ var _ = Describe("receivedPacketHandler", func() {
|
|||
Expect(handler.ackQueued).To(BeTrue())
|
||||
})
|
||||
|
||||
It("doesn't queue an ACK if it was reported missing before, but is below the threshold", func() {
|
||||
receiveAndAck10Packets()
|
||||
// 11 is missing
|
||||
err := handler.ReceivedPacket(12, time.Time{}, true)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
err = handler.ReceivedPacket(13, time.Time{}, true)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
ack := handler.GetAckFrame() // ACK: 1-10, 12-13
|
||||
Expect(ack).ToNot(BeNil())
|
||||
// now receive 11
|
||||
handler.IgnoreBelow(12)
|
||||
err = handler.ReceivedPacket(11, time.Time{}, false)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
ack = handler.GetAckFrame()
|
||||
Expect(ack).To(BeNil())
|
||||
})
|
||||
|
||||
It("doesn't queue an ACK if the packet closes a gap that was not yet reported", func() {
|
||||
receiveAndAckPacketsUntilAckDecimation()
|
||||
p := protocol.PacketNumber(minReceivedBeforeAckDecimation + 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue