use the max_ack_delay when computing the PTO duration

This commit is contained in:
Marten Seemann
2019-05-08 14:47:46 +09:00
parent 537737935c
commit 4e6df9041d
2 changed files with 2 additions and 3 deletions

View File

@@ -631,8 +631,7 @@ func (h *sentPacketHandler) computeCryptoTimeout() time.Duration {
}
func (h *sentPacketHandler) computePTOTimeout() time.Duration {
// TODO(#1236): include the max_ack_delay
duration := utils.MaxDuration(h.rttStats.SmoothedOrInitialRTT()+4*h.rttStats.MeanDeviation(), protocol.TimerGranularity)
duration := h.rttStats.SmoothedOrInitialRTT() + utils.MaxDuration(4*h.rttStats.MeanDeviation(), protocol.TimerGranularity) + h.maxAckDelay
return duration << h.ptoCount
}

View File

@@ -619,7 +619,7 @@ var _ = Describe("SentPacketHandler", func() {
It("uses the granularity for short RTTs", func() {
rtt := time.Microsecond
updateRTT(rtt)
Expect(handler.computePTOTimeout()).To(Equal(protocol.TimerGranularity))
Expect(handler.computePTOTimeout()).To(Equal(rtt + protocol.TimerGranularity))
})
It("implements exponential backoff", func() {