diff --git a/ackhandler/sent_packet_handler.go b/ackhandler/sent_packet_handler.go index a864c9ed..276ac853 100644 --- a/ackhandler/sent_packet_handler.go +++ b/ackhandler/sent_packet_handler.go @@ -329,6 +329,8 @@ func (h *sentPacketHandler) maybeQueuePacketsRTO() { h.congestion.OnRetransmissionTimeout(true) utils.Debugf("\tQueueing packet 0x%x for retransmission (RTO)", packet.PacketNumber) h.queuePacketForRetransmission(el) + // Reset the RTO timer here, since it's not clear that this packet contained any retransmittable frames + h.lastSentPacketTime = time.Now() return } } diff --git a/ackhandler/sent_packet_handler_test.go b/ackhandler/sent_packet_handler_test.go index 33918897..15da4da2 100644 --- a/ackhandler/sent_packet_handler_test.go +++ b/ackhandler/sent_packet_handler_test.go @@ -878,6 +878,7 @@ var _ = Describe("SentPacketHandler", func() { handler.maybeQueuePacketsRTO() Expect(handler.retransmissionQueue).To(HaveLen(1)) Expect(handler.retransmissionQueue[0].PacketNumber).To(Equal(p.PacketNumber)) + Expect(time.Now().Sub(handler.lastSentPacketTime)).To(BeNumerically("<", time.Second/2)) }) }) diff --git a/ackhandlerlegacy/sent_packet_handler.go b/ackhandlerlegacy/sent_packet_handler.go index 42e21d64..325e6fdf 100644 --- a/ackhandlerlegacy/sent_packet_handler.go +++ b/ackhandlerlegacy/sent_packet_handler.go @@ -344,6 +344,8 @@ func (h *sentPacketHandler) maybeQueuePacketsRTO() { h.congestion.OnRetransmissionTimeout(true) utils.Debugf("\tQueueing packet 0x%x for retransmission (RTO)", packet.PacketNumber) h.queuePacketForRetransmission(packet) + // Reset the RTO timer here, since it's not clear that this packet contained any retransmittable frames + h.lastSentPacketTime = time.Now() return } } diff --git a/ackhandlerlegacy/sent_packet_handler_test.go b/ackhandlerlegacy/sent_packet_handler_test.go index a7284bbd..e8e5a40e 100644 --- a/ackhandlerlegacy/sent_packet_handler_test.go +++ b/ackhandlerlegacy/sent_packet_handler_test.go @@ -778,6 +778,7 @@ var _ = Describe("SentPacketHandler", func() { handler.maybeQueuePacketsRTO() Expect(handler.retransmissionQueue).To(HaveLen(1)) Expect(handler.retransmissionQueue[0]).To(Equal(p)) + Expect(time.Now().Sub(handler.lastSentPacketTime)).To(BeNumerically("<", time.Second/2)) }) It("does not queue retransmittedpackets", func() {