Merge pull request #3129 from lucas-clemente/limit-retry-rtt-measurement

don't use a lower RTT than 5ms after receiving a Retry packet
This commit is contained in:
Marten Seemann 2021-04-02 19:30:06 +07:00 committed by GitHub
commit 3138a45fde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View file

@ -1233,6 +1233,21 @@ var _ = Describe("SentPacketHandler", func() {
Expect(handler.rttStats.SmoothedRTT()).To(BeNumerically("~", 500*time.Millisecond, 100*time.Millisecond))
})
It("uses a Retry for an RTT estimate, but doesn't set the RTT to a value lower than 5ms", func() {
handler.SentPacket(ackElicitingPacket(&Packet{
PacketNumber: 42,
EncryptionLevel: protocol.EncryptionInitial,
SendTime: time.Now().Add(-500 * time.Microsecond),
}))
handler.SentPacket(ackElicitingPacket(&Packet{
PacketNumber: 43,
EncryptionLevel: protocol.EncryptionInitial,
SendTime: time.Now().Add(-10 * time.Microsecond),
}))
Expect(handler.ResetForRetry()).To(Succeed())
Expect(handler.rttStats.SmoothedRTT()).To(Equal(minRTTAfterRetry))
})
It("doesn't use a Retry for an RTT estimate, if it was not retransmitted", func() {
handler.SentPacket(ackElicitingPacket(&Packet{
PacketNumber: 42,