forked from quic-go/quic-go
ackhandler: fix handling of lost path probes on loss timer (#4956)
This commit is contained in:
@@ -658,6 +658,7 @@ func (h *sentPacketHandler) detectLostPathProbes(now time.Time) {
|
||||
for _, f := range p.Frames {
|
||||
f.Handler.OnLost(f.Frame)
|
||||
}
|
||||
h.appDataPackets.history.Remove(p.PacketNumber)
|
||||
h.appDataPackets.history.RemovePathProbe(p.PacketNumber)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1205,13 +1205,19 @@ func TestSentPacketHandlerPathProbeAckAndLoss(t *testing.T) {
|
||||
t1 := now
|
||||
now = now.Add(100 * time.Millisecond)
|
||||
_ = sendPacket(now, true)
|
||||
t2 := now
|
||||
now = now.Add(100 * time.Millisecond)
|
||||
pn3 := sendPacket(now, true)
|
||||
|
||||
now = now.Add(100 * time.Millisecond)
|
||||
require.Equal(t, t1.Add(pathProbePacketLossTimeout), sph.GetLossDetectionTimeout())
|
||||
require.NoError(t, sph.OnLossDetectionTimeout(sph.GetLossDetectionTimeout()))
|
||||
require.Equal(t, []protocol.PacketNumber{pn1}, packets.Lost)
|
||||
packets.Lost = packets.Lost[:0]
|
||||
|
||||
// receive a delayed ACK for the path probe packet
|
||||
_, err := sph.ReceivedAck(
|
||||
&wire.AckFrame{AckRanges: ackRanges(pn3)},
|
||||
&wire.AckFrame{AckRanges: ackRanges(pn1, pn3)},
|
||||
protocol.Encryption1RTT,
|
||||
now,
|
||||
)
|
||||
@@ -1219,8 +1225,5 @@ func TestSentPacketHandlerPathProbeAckAndLoss(t *testing.T) {
|
||||
require.Equal(t, []protocol.PacketNumber{pn3}, packets.Acked)
|
||||
require.Empty(t, packets.Lost)
|
||||
|
||||
require.Equal(t, t1.Add(pathProbePacketLossTimeout), sph.GetLossDetectionTimeout())
|
||||
|
||||
require.NoError(t, sph.OnLossDetectionTimeout(sph.GetLossDetectionTimeout()))
|
||||
require.Equal(t, []protocol.PacketNumber{pn1}, packets.Lost)
|
||||
require.Equal(t, t2.Add(pathProbePacketLossTimeout), sph.GetLossDetectionTimeout())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user