diff --git a/internal/ackhandler/sent_packet_handler.go b/internal/ackhandler/sent_packet_handler.go index f155bdd9..64e380e6 100644 --- a/internal/ackhandler/sent_packet_handler.go +++ b/internal/ackhandler/sent_packet_handler.go @@ -185,7 +185,7 @@ func (h *sentPacketHandler) ReceivedAck(ackFrame *wire.AckFrame, withPacketNumbe } // duplicate or out of order ACK - if withPacketNumber != 0 && withPacketNumber <= h.largestReceivedPacketWithAck { + if withPacketNumber != 0 && withPacketNumber < h.largestReceivedPacketWithAck { h.logger.Debugf("Ignoring ACK frame (duplicate or out of order).") return nil } diff --git a/internal/ackhandler/sent_packet_handler_test.go b/internal/ackhandler/sent_packet_handler_test.go index fabdd133..ec4f6502 100644 --- a/internal/ackhandler/sent_packet_handler_test.go +++ b/internal/ackhandler/sent_packet_handler_test.go @@ -146,7 +146,7 @@ var _ = Describe("SentPacketHandler", func() { Expect(handler.largestAcked).To(Equal(protocol.PacketNumber(5))) }) - It("rejects duplicate ACKs", func() { + It("accepts multiple ACKs sent in the same packet", func() { ack1 := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 0, Largest: 3}}} ack2 := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 0, Largest: 4}}} err := handler.ReceivedAck(ack1, 1337, protocol.Encryption1RTT, time.Now()) @@ -156,7 +156,7 @@ var _ = Describe("SentPacketHandler", func() { // for testing purposes, we pretend send a different ACK frame in a duplicated packet, to be able to verify that it actually doesn't get processed err = handler.ReceivedAck(ack2, 1337, protocol.Encryption1RTT, time.Now()) Expect(err).ToNot(HaveOccurred()) - Expect(handler.largestAcked).To(Equal(protocol.PacketNumber(3))) + Expect(handler.largestAcked).To(Equal(protocol.PacketNumber(4))) }) It("rejects out of order ACKs", func() {