mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 13:17:36 +03:00
notify the congestion controller of losses first
This commit is contained in:
parent
e2e3e10a63
commit
269f14d86c
2 changed files with 7 additions and 7 deletions
|
@ -277,16 +277,16 @@ func (h *sentPacketHandler) ReceivedAck(ack *wire.AckFrame, encLevel protocol.En
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := h.detectAndRemoveLostPackets(rcvTime, encLevel, priorInFlight); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
for _, p := range ackedPackets {
|
for _, p := range ackedPackets {
|
||||||
if p.includedInBytesInFlight {
|
if p.includedInBytesInFlight {
|
||||||
h.congestion.OnPacketAcked(p.PacketNumber, p.Length, priorInFlight, rcvTime)
|
h.congestion.OnPacketAcked(p.PacketNumber, p.Length, priorInFlight, rcvTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := h.detectAndRemoveLostPackets(rcvTime, encLevel, priorInFlight); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if h.qlogger != nil && h.ptoCount != 0 {
|
if h.qlogger != nil && h.ptoCount != 0 {
|
||||||
h.qlogger.UpdatedPTOCount(0)
|
h.qlogger.UpdatedPTOCount(0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -460,8 +460,8 @@ var _ = Describe("SentPacketHandler", func() {
|
||||||
// lose packet 1
|
// lose packet 1
|
||||||
gomock.InOrder(
|
gomock.InOrder(
|
||||||
cong.EXPECT().MaybeExitSlowStart(),
|
cong.EXPECT().MaybeExitSlowStart(),
|
||||||
cong.EXPECT().OnPacketAcked(protocol.PacketNumber(2), protocol.ByteCount(1), protocol.ByteCount(2), gomock.Any()),
|
|
||||||
cong.EXPECT().OnPacketLost(protocol.PacketNumber(1), protocol.ByteCount(1), protocol.ByteCount(2)),
|
cong.EXPECT().OnPacketLost(protocol.PacketNumber(1), protocol.ByteCount(1), protocol.ByteCount(2)),
|
||||||
|
cong.EXPECT().OnPacketAcked(protocol.PacketNumber(2), protocol.ByteCount(1), protocol.ByteCount(2), gomock.Any()),
|
||||||
)
|
)
|
||||||
ack := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 2, Largest: 2}}}
|
ack := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 2, Largest: 2}}}
|
||||||
Expect(handler.ReceivedAck(ack, protocol.Encryption1RTT, time.Now())).To(Succeed())
|
Expect(handler.ReceivedAck(ack, protocol.Encryption1RTT, time.Now())).To(Succeed())
|
||||||
|
@ -480,16 +480,16 @@ var _ = Describe("SentPacketHandler", func() {
|
||||||
// receive the first ACK
|
// receive the first ACK
|
||||||
gomock.InOrder(
|
gomock.InOrder(
|
||||||
cong.EXPECT().MaybeExitSlowStart(),
|
cong.EXPECT().MaybeExitSlowStart(),
|
||||||
cong.EXPECT().OnPacketAcked(protocol.PacketNumber(2), protocol.ByteCount(1), protocol.ByteCount(4), gomock.Any()),
|
|
||||||
cong.EXPECT().OnPacketLost(protocol.PacketNumber(1), protocol.ByteCount(1), protocol.ByteCount(4)),
|
cong.EXPECT().OnPacketLost(protocol.PacketNumber(1), protocol.ByteCount(1), protocol.ByteCount(4)),
|
||||||
|
cong.EXPECT().OnPacketAcked(protocol.PacketNumber(2), protocol.ByteCount(1), protocol.ByteCount(4), gomock.Any()),
|
||||||
)
|
)
|
||||||
ack := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 2, Largest: 2}}}
|
ack := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 2, Largest: 2}}}
|
||||||
Expect(handler.ReceivedAck(ack, protocol.Encryption1RTT, time.Now().Add(-30*time.Minute))).To(Succeed())
|
Expect(handler.ReceivedAck(ack, protocol.Encryption1RTT, time.Now().Add(-30*time.Minute))).To(Succeed())
|
||||||
// receive the second ACK
|
// receive the second ACK
|
||||||
gomock.InOrder(
|
gomock.InOrder(
|
||||||
cong.EXPECT().MaybeExitSlowStart(),
|
cong.EXPECT().MaybeExitSlowStart(),
|
||||||
cong.EXPECT().OnPacketAcked(protocol.PacketNumber(4), protocol.ByteCount(1), protocol.ByteCount(2), gomock.Any()),
|
|
||||||
cong.EXPECT().OnPacketLost(protocol.PacketNumber(3), protocol.ByteCount(1), protocol.ByteCount(2)),
|
cong.EXPECT().OnPacketLost(protocol.PacketNumber(3), protocol.ByteCount(1), protocol.ByteCount(2)),
|
||||||
|
cong.EXPECT().OnPacketAcked(protocol.PacketNumber(4), protocol.ByteCount(1), protocol.ByteCount(2), gomock.Any()),
|
||||||
)
|
)
|
||||||
ack = &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 4, Largest: 4}}}
|
ack = &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 4, Largest: 4}}}
|
||||||
Expect(handler.ReceivedAck(ack, protocol.Encryption1RTT, time.Now())).To(Succeed())
|
Expect(handler.ReceivedAck(ack, protocol.Encryption1RTT, time.Now())).To(Succeed())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue