From da4c0153c8b1075d64ec149788fef9055fee26b4 Mon Sep 17 00:00:00 2001 From: Toby Date: Fri, 29 Sep 2023 21:55:47 -0700 Subject: [PATCH] chore: tweak SendAlgorithmEx interface (cherry picked from commit 13cecb45baa801ed413f2e105fde7fb2b3d9334e) --- internal/ackhandler/cc_adapter.go | 5 ++++- internal/congestion/interface.go | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/ackhandler/cc_adapter.go b/internal/ackhandler/cc_adapter.go index fa0cebf6ccd..659ab83495a 100644 --- a/internal/ackhandler/cc_adapter.go +++ b/internal/ackhandler/cc_adapter.go @@ -8,7 +8,10 @@ import ( "github.com/quic-go/quic-go/internal/protocol" ) -var _ cgInternal.SendAlgorithmEx = &ccAdapter{} +var ( + _ cgInternal.SendAlgorithmEx = &ccAdapter{} + _ cgInternal.SendAlgorithmWithDebugInfos = &ccAdapter{} +) type ccAdapter struct { CC congestion.CongestionControl diff --git a/internal/congestion/interface.go b/internal/congestion/interface.go index da052159e66..54fcbbea35b 100644 --- a/internal/congestion/interface.go +++ b/internal/congestion/interface.go @@ -20,6 +20,11 @@ type SendAlgorithm interface { SetMaxDatagramSize(protocol.ByteCount) } +type SendAlgorithmEx interface { + SendAlgorithm + OnCongestionEventEx(priorInFlight protocol.ByteCount, eventTime time.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) +} + // A SendAlgorithmWithDebugInfos is a SendAlgorithm that exposes some debug infos type SendAlgorithmWithDebugInfos interface { SendAlgorithm @@ -27,8 +32,3 @@ type SendAlgorithmWithDebugInfos interface { InRecovery() bool GetCongestionWindow() protocol.ByteCount } - -type SendAlgorithmEx interface { - SendAlgorithmWithDebugInfos - OnCongestionEventEx(priorInFlight protocol.ByteCount, eventTime time.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) -}