forked from quic-go/quic-go
remove the {Lowest, Largest}Acked from the ACK frame
All ACK ranges are now saved in the AckRanges slices. This eliminates a bunch of special cases for ACKs that don't report any packets missing.
This commit is contained in:
@@ -91,7 +91,7 @@ func (h *receivedPacketHandler) isMissing(p protocol.PacketNumber) bool {
|
||||
if h.lastAck == nil {
|
||||
return false
|
||||
}
|
||||
return p < h.lastAck.LargestAcked && !h.lastAck.AcksPacket(p)
|
||||
return p < h.lastAck.LargestAcked() && !h.lastAck.AcksPacket(p)
|
||||
}
|
||||
|
||||
func (h *receivedPacketHandler) hasNewMissingPackets() bool {
|
||||
@@ -99,7 +99,7 @@ func (h *receivedPacketHandler) hasNewMissingPackets() bool {
|
||||
return false
|
||||
}
|
||||
highestRange := h.packetHistory.GetHighestAckRange()
|
||||
return highestRange.Smallest >= h.lastAck.LargestAcked && highestRange.Len() <= maxPacketsAfterNewMissing
|
||||
return highestRange.Smallest >= h.lastAck.LargestAcked() && highestRange.Len() <= maxPacketsAfterNewMissing
|
||||
}
|
||||
|
||||
// maybeQueueAck queues an ACK, if necessary.
|
||||
@@ -163,17 +163,11 @@ func (h *receivedPacketHandler) GetAckFrame() *wire.AckFrame {
|
||||
return nil
|
||||
}
|
||||
|
||||
ackRanges := h.packetHistory.GetAckRanges()
|
||||
ack := &wire.AckFrame{
|
||||
LargestAcked: h.largestObserved,
|
||||
LowestAcked: ackRanges[len(ackRanges)-1].Smallest,
|
||||
AckRanges: h.packetHistory.GetAckRanges(),
|
||||
PacketReceivedTime: h.largestObservedReceivedTime,
|
||||
}
|
||||
|
||||
if len(ackRanges) > 1 {
|
||||
ack.AckRanges = ackRanges
|
||||
}
|
||||
|
||||
h.lastAck = ack
|
||||
h.ackAlarm = time.Time{}
|
||||
h.ackQueued = false
|
||||
|
||||
Reference in New Issue
Block a user