pass the current timestamp to the pacer instead of calling time.Now() (#3824)

This commit is contained in:
Marten Seemann
2023-06-03 10:26:30 +03:00
committed by GitHub
parent 072a602cc1
commit b27d114f07
9 changed files with 114 additions and 127 deletions

View File

@@ -9,7 +9,7 @@ import (
// A SendAlgorithm performs congestion control
type SendAlgorithm interface {
TimeUntilSend(bytesInFlight protocol.ByteCount) time.Time
HasPacingBudget() bool
HasPacingBudget(now time.Time) bool
OnPacketSent(sentTime time.Time, bytesInFlight protocol.ByteCount, packetNumber protocol.PacketNumber, bytes protocol.ByteCount, isRetransmittable bool)
CanSend(bytesInFlight protocol.ByteCount) bool
MaybeExitSlowStart()