mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 13:17:36 +03:00
Merge pull request #1858 from lucas-clemente/reset-send-mode-after-ack
reset the send mode after receiving an ACK when already in PTO mode
This commit is contained in:
commit
a63ee3d88f
2 changed files with 11 additions and 0 deletions
|
@ -246,6 +246,7 @@ func (h *sentPacketHandler) ReceivedAck(ackFrame *wire.AckFrame, withPacketNumbe
|
||||||
|
|
||||||
h.ptoCount = 0
|
h.ptoCount = 0
|
||||||
h.cryptoCount = 0
|
h.cryptoCount = 0
|
||||||
|
h.numProbesToSend = 0
|
||||||
|
|
||||||
h.updateLossDetectionAlarm()
|
h.updateLossDetectionAlarm()
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -680,6 +680,16 @@ var _ = Describe("SentPacketHandler", func() {
|
||||||
Expect(handler.retransmissionQueue).To(BeEmpty()) // 1 and 2 were already sent as probe packets
|
Expect(handler.retransmissionQueue).To(BeEmpty()) // 1 and 2 were already sent as probe packets
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("resets the send mode when it receives an acknowledgement after queueing probe packets", func() {
|
||||||
|
handler.SentPacket(retransmittablePacket(&Packet{PacketNumber: 1, SendTime: time.Now().Add(-time.Hour)}))
|
||||||
|
handler.rttStats.UpdateRTT(time.Second, 0, time.Now())
|
||||||
|
handler.OnAlarm()
|
||||||
|
Expect(handler.SendMode()).To(Equal(SendPTO))
|
||||||
|
ack := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 1, Largest: 1}}}
|
||||||
|
Expect(handler.ReceivedAck(ack, 1, protocol.Encryption1RTT, time.Now())).To(Succeed())
|
||||||
|
Expect(handler.SendMode()).To(Equal(SendAny))
|
||||||
|
})
|
||||||
|
|
||||||
It("gets packets sent before the probe packet for retransmission", func() {
|
It("gets packets sent before the probe packet for retransmission", func() {
|
||||||
handler.SentPacket(retransmittablePacket(&Packet{PacketNumber: 1, SendTime: time.Now().Add(-time.Hour)}))
|
handler.SentPacket(retransmittablePacket(&Packet{PacketNumber: 1, SendTime: time.Now().Add(-time.Hour)}))
|
||||||
handler.SentPacket(retransmittablePacket(&Packet{PacketNumber: 2, SendTime: time.Now().Add(-time.Hour)}))
|
handler.SentPacket(retransmittablePacket(&Packet{PacketNumber: 2, SendTime: time.Now().Add(-time.Hour)}))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue