forked from quic-go/quic-go
use the max_ack_delay when computing the PTO duration
This commit is contained in:
@@ -631,8 +631,7 @@ func (h *sentPacketHandler) computeCryptoTimeout() time.Duration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *sentPacketHandler) computePTOTimeout() time.Duration {
|
func (h *sentPacketHandler) computePTOTimeout() time.Duration {
|
||||||
// TODO(#1236): include the max_ack_delay
|
duration := h.rttStats.SmoothedOrInitialRTT() + utils.MaxDuration(4*h.rttStats.MeanDeviation(), protocol.TimerGranularity) + h.maxAckDelay
|
||||||
duration := utils.MaxDuration(h.rttStats.SmoothedOrInitialRTT()+4*h.rttStats.MeanDeviation(), protocol.TimerGranularity)
|
|
||||||
return duration << h.ptoCount
|
return duration << h.ptoCount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -619,7 +619,7 @@ var _ = Describe("SentPacketHandler", func() {
|
|||||||
It("uses the granularity for short RTTs", func() {
|
It("uses the granularity for short RTTs", func() {
|
||||||
rtt := time.Microsecond
|
rtt := time.Microsecond
|
||||||
updateRTT(rtt)
|
updateRTT(rtt)
|
||||||
Expect(handler.computePTOTimeout()).To(Equal(protocol.TimerGranularity))
|
Expect(handler.computePTOTimeout()).To(Equal(rtt + protocol.TimerGranularity))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("implements exponential backoff", func() {
|
It("implements exponential backoff", func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user