ackhandler: use an iterator to process received packet ranges (#5309)

* ackhandler: use an interator to track received packet ranges

* use slices.Collect

* naming convention
This commit is contained in:
Marten Seemann
2025-08-28 16:32:26 +08:00
committed by GitHub
parent cead8cfbd6
commit 0cd4bd940b
3 changed files with 62 additions and 58 deletions

View File

@@ -61,7 +61,9 @@ func (h *receivedPacketTracker) GetAckFrame() *wire.AckFrame {
ack.ECT0 = h.ect0
ack.ECT1 = h.ect1
ack.ECNCE = h.ecnce
ack.AckRanges = h.packetHistory.AppendAckRanges(ack.AckRanges)
for r := range h.packetHistory.Backward() {
ack.AckRanges = append(ack.AckRanges, wire.AckRange{Smallest: r.Start, Largest: r.End})
}
h.lastAck = ack
h.hasNewAck = false