don't regard PMTU probe packets as outstanding

This also means that PMTU probe packets won't be sent as PTO probe packets.
This commit is contained in:
Marten Seemann
2021-03-26 09:25:01 +07:00
parent 81d16a9903
commit 5bdbff929d
2 changed files with 11 additions and 2 deletions

View File

@@ -64,8 +64,9 @@ func (h *sentPacketHistory) Iterate(cb func(*Packet) (cont bool, err error)) err
// FirstOutStanding returns the first outstanding packet.
func (h *sentPacketHistory) FirstOutstanding() *Packet {
for el := h.packetList.Front(); el != nil; el = el.Next() {
if !el.Value.declaredLost && !el.Value.skippedPacket {
return &el.Value
p := &el.Value
if !p.declaredLost && !p.skippedPacket && !p.IsPathMTUProbePacket {
return p
}
}
return nil

View File

@@ -87,6 +87,14 @@ var _ = Describe("SentPacketHistory", func() {
Expect(front).ToNot(BeNil())
Expect(front.PacketNumber).To(Equal(protocol.PacketNumber(2)))
})
It("doesn't regard path MTU packets as outstanding", func() {
hist.SentPacket(&Packet{PacketNumber: 2}, true)
hist.SentPacket(&Packet{PacketNumber: 4, IsPathMTUProbePacket: true}, true)
front := hist.FirstOutstanding()
Expect(front).ToNot(BeNil())
Expect(front.PacketNumber).To(Equal(protocol.PacketNumber(2)))
})
})
It("removes packets", func() {