Skip to content

Commit

Permalink
Merge pull request #3126 from lucas-clemente/dont-pto-pmtu-packets
Browse files Browse the repository at this point in the history
don't regard PMTU probe packets as outstanding
  • Loading branch information
marten-seemann authored Apr 2, 2021
2 parents 8d44a3c + 5bdbff9 commit 37a3938
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/ackhandler/sent_packet_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions internal/ackhandler/sent_packet_history_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 37a3938

Please sign in to comment.