don't send path MTU probe packets on a timer (#3423)

This commit is contained in:
Marten Seemann
2022-05-20 12:10:39 +02:00
committed by GitHub
parent de5f08171b
commit 2e98150cd4
5 changed files with 2 additions and 39 deletions

View File

@@ -11,7 +11,6 @@ import (
type mtuDiscoverer interface {
ShouldSendProbe(now time.Time) bool
NextProbeTime() time.Time
GetPing() (ping ackhandler.Frame, datagramSize protocol.ByteCount)
}
@@ -53,16 +52,7 @@ func (f *mtuFinder) ShouldSendProbe(now time.Time) bool {
if f.probeInFlight || f.done() {
return false
}
return !now.Before(f.NextProbeTime())
}
// NextProbeTime returns the time when the next probe packet should be sent.
// It returns the zero value if no probe packet should be sent.
func (f *mtuFinder) NextProbeTime() time.Time {
if f.probeInFlight || f.done() {
return time.Time{}
}
return f.lastProbeTime.Add(mtuProbeDelay * f.rttStats.SmoothedRTT())
return !now.Before(f.lastProbeTime.Add(mtuProbeDelay * f.rttStats.SmoothedRTT()))
}
func (f *mtuFinder) GetPing() (ackhandler.Frame, protocol.ByteCount) {