forked from quic-go/quic-go
reset the RTO timer when queueing an RTO retransmission
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user