mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 13:17:36 +03:00
only send one ACK for every 10 retransmittable packets
This commit is contained in:
parent
96a31a51e5
commit
fc5f54824a
2 changed files with 10 additions and 6 deletions
|
@ -95,13 +95,17 @@ var _ = Describe("receivedPacketHandler", func() {
|
||||||
Expect(handler.GetAlarmTimeout()).To(BeZero())
|
Expect(handler.GetAlarmTimeout()).To(BeZero())
|
||||||
})
|
})
|
||||||
|
|
||||||
It("queues an ACK for every second retransmittable packet, if they are arriving fast", func() {
|
It("queues an ACK for every RetransmittablePacketsBeforeAck retransmittable packet, if they are arriving fast", func() {
|
||||||
receiveAndAck10Packets()
|
receiveAndAck10Packets()
|
||||||
err := handler.ReceivedPacket(11, time.Time{}, true)
|
p := protocol.PacketNumber(11)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
for i := 0; i < protocol.RetransmittablePacketsBeforeAck-1; i++ {
|
||||||
Expect(handler.ackQueued).To(BeFalse())
|
err := handler.ReceivedPacket(p, time.Time{}, true)
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
Expect(handler.ackQueued).To(BeFalse())
|
||||||
|
p++
|
||||||
|
}
|
||||||
Expect(handler.GetAlarmTimeout()).NotTo(BeZero())
|
Expect(handler.GetAlarmTimeout()).NotTo(BeZero())
|
||||||
err = handler.ReceivedPacket(12, time.Time{}, true)
|
err := handler.ReceivedPacket(p, time.Time{}, true)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(handler.ackQueued).To(BeTrue())
|
Expect(handler.ackQueued).To(BeTrue())
|
||||||
Expect(handler.GetAlarmTimeout()).To(BeZero())
|
Expect(handler.GetAlarmTimeout()).To(BeZero())
|
||||||
|
|
|
@ -94,7 +94,7 @@ const MaxTrackedReceivedAckRanges = DefaultMaxCongestionWindow
|
||||||
const MaxNonRetransmittablePackets = 19
|
const MaxNonRetransmittablePackets = 19
|
||||||
|
|
||||||
// RetransmittablePacketsBeforeAck is the number of retransmittable that an ACK is sent for
|
// RetransmittablePacketsBeforeAck is the number of retransmittable that an ACK is sent for
|
||||||
const RetransmittablePacketsBeforeAck = 2
|
const RetransmittablePacketsBeforeAck = 10
|
||||||
|
|
||||||
// MaxStreamFrameSorterGaps is the maximum number of gaps between received StreamFrames
|
// MaxStreamFrameSorterGaps is the maximum number of gaps between received StreamFrames
|
||||||
// prevents DoS attacks against the streamFrameSorter
|
// prevents DoS attacks against the streamFrameSorter
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue