mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 12:47:36 +03:00
don't switch to PTO mode after early retransmit
This commit is contained in:
parent
ee8a0aeb1b
commit
64ef72fd68
2 changed files with 9 additions and 0 deletions
|
@ -913,6 +913,7 @@ var _ = Describe("SentPacketHandler", func() {
|
|||
})
|
||||
|
||||
It("sets the early retransmit alarm", func() {
|
||||
handler.ReceivedPacket(protocol.EncryptionHandshake)
|
||||
handler.handshakeComplete = true
|
||||
now := time.Now()
|
||||
handler.SentPacket(ackElicitingPacket(&Packet{PacketNumber: 1, SendTime: now.Add(-2 * time.Second)}))
|
||||
|
@ -926,12 +927,16 @@ var _ = Describe("SentPacketHandler", func() {
|
|||
|
||||
// Packet 1 should be considered lost (1+1/8) RTTs after it was sent.
|
||||
Expect(handler.GetLossDetectionTimeout().Sub(getPacket(1, protocol.Encryption1RTT).SendTime)).To(Equal(time.Second * 9 / 8))
|
||||
Expect(handler.SendMode()).To(Equal(SendAny))
|
||||
|
||||
expectInPacketHistory([]protocol.PacketNumber{1, 3}, protocol.Encryption1RTT)
|
||||
Expect(handler.OnLossDetectionTimeout()).To(Succeed())
|
||||
expectInPacketHistory([]protocol.PacketNumber{3}, protocol.Encryption1RTT)
|
||||
Expect(handler.SendMode()).To(Equal(SendAny))
|
||||
})
|
||||
|
||||
It("sets the early retransmit alarm for crypto packets", func() {
|
||||
handler.ReceivedBytes(1000)
|
||||
now := time.Now()
|
||||
handler.SentPacket(initialPacket(&Packet{PacketNumber: 1, SendTime: now.Add(-2 * time.Second)}))
|
||||
handler.SentPacket(initialPacket(&Packet{PacketNumber: 2, SendTime: now.Add(-2 * time.Second)}))
|
||||
|
@ -944,9 +949,12 @@ var _ = Describe("SentPacketHandler", func() {
|
|||
|
||||
// Packet 1 should be considered lost (1+1/8) RTTs after it was sent.
|
||||
Expect(handler.GetLossDetectionTimeout().Sub(getPacket(1, protocol.EncryptionInitial).SendTime)).To(Equal(time.Second * 9 / 8))
|
||||
Expect(handler.SendMode()).To(Equal(SendAny))
|
||||
|
||||
expectInPacketHistory([]protocol.PacketNumber{1, 3}, protocol.EncryptionInitial)
|
||||
Expect(handler.OnLossDetectionTimeout()).To(Succeed())
|
||||
expectInPacketHistory([]protocol.PacketNumber{3}, protocol.EncryptionInitial)
|
||||
Expect(handler.SendMode()).To(Equal(SendAny))
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue