add a function to get the highest ACK range in receivedPacketHistory

This commit is contained in:
Marten Seemann
2017-01-08 19:36:59 +07:00
parent 7fc9d59381
commit 634d2dc6b7
2 changed files with 29 additions and 0 deletions

View File

@@ -133,3 +133,13 @@ func (h *receivedPacketHistory) GetAckRanges() []frames.AckRange {
return ackRanges
}
func (h *receivedPacketHistory) GetHighestAckRange() frames.AckRange {
ackRange := frames.AckRange{}
if h.ranges.Len() > 0 {
r := h.ranges.Back().Value
ackRange.FirstPacketNumber = r.Start
ackRange.LastPacketNumber = r.End
}
return ackRange
}