mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
correctly set the ack delay in an ACK of packet number 0
This commit is contained in:
parent
8ac77be934
commit
5e3c96024a
2 changed files with 5 additions and 5 deletions
|
@ -74,7 +74,7 @@ func (h *receivedPacketHandler) ReceivedPacket(packetNumber protocol.PacketNumbe
|
|||
}
|
||||
|
||||
isMissing := h.isMissing(packetNumber)
|
||||
if packetNumber > h.largestObserved {
|
||||
if packetNumber >= h.largestObserved {
|
||||
h.largestObserved = packetNumber
|
||||
h.largestObservedReceivedTime = rcvTime
|
||||
}
|
||||
|
|
|
@ -95,17 +95,17 @@ var _ = Describe("receivedPacketHandler", func() {
|
|||
}
|
||||
|
||||
It("always queues an ACK for the first packet", func() {
|
||||
err := handler.ReceivedPacket(1, time.Time{}, false)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(handler.ReceivedPacket(1, time.Now(), false)).To(Succeed())
|
||||
Expect(handler.ackQueued).To(BeTrue())
|
||||
Expect(handler.GetAlarmTimeout()).To(BeZero())
|
||||
Expect(handler.GetAckFrame().DelayTime).To(BeNumerically("~", 0, time.Second))
|
||||
})
|
||||
|
||||
It("works with packet number 0", func() {
|
||||
err := handler.ReceivedPacket(0, time.Time{}, false)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(handler.ReceivedPacket(0, time.Now(), false)).To(Succeed())
|
||||
Expect(handler.ackQueued).To(BeTrue())
|
||||
Expect(handler.GetAlarmTimeout()).To(BeZero())
|
||||
Expect(handler.GetAckFrame().DelayTime).To(BeNumerically("~", 0, time.Second))
|
||||
})
|
||||
|
||||
It("queues an ACK for every second retransmittable packet at the beginning", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue