remove unused RTTStats from the received packet handler (#4287)

This commit is contained in:
Marten Seemann 2024-01-30 16:02:30 +07:00 committed by GitHub
parent be4838bd64
commit d330d2e30d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 26 deletions

View file

@ -20,5 +20,5 @@ func NewAckHandler(
logger utils.Logger,
) (SentPacketHandler, ReceivedPacketHandler) {
sph := newSentPacketHandler(initialPacketNumber, initialMaxDatagramSize, rttStats, clientAddressValidated, enableECN, pers, tracer, logger)
return sph, newReceivedPacketHandler(sph, rttStats, logger)
return sph, newReceivedPacketHandler(sph, logger)
}

View file

@ -21,16 +21,12 @@ type receivedPacketHandler struct {
var _ ReceivedPacketHandler = &receivedPacketHandler{}
func newReceivedPacketHandler(
sentPackets sentPacketTracker,
rttStats *utils.RTTStats,
logger utils.Logger,
) ReceivedPacketHandler {
func newReceivedPacketHandler(sentPackets sentPacketTracker, logger utils.Logger) ReceivedPacketHandler {
return &receivedPacketHandler{
sentPackets: sentPackets,
initialPackets: newReceivedPacketTracker(rttStats, logger),
handshakePackets: newReceivedPacketTracker(rttStats, logger),
appDataPackets: newReceivedPacketTracker(rttStats, logger),
initialPackets: newReceivedPacketTracker(logger),
handshakePackets: newReceivedPacketTracker(logger),
appDataPackets: newReceivedPacketTracker(logger),
lowest1RTTPacket: protocol.InvalidPacketNumber,
}
}

View file

@ -18,11 +18,7 @@ var _ = Describe("Received Packet Handler", func() {
BeforeEach(func() {
sentPackets = NewMockSentPacketTracker(mockCtrl)
handler = newReceivedPacketHandler(
sentPackets,
&utils.RTTStats{},
utils.DefaultLogger,
)
handler = newReceivedPacketHandler(sentPackets, utils.DefaultLogger)
})
It("generates ACKs for different packet number spaces", func() {

View file

@ -21,7 +21,6 @@ type receivedPacketTracker struct {
packetHistory *receivedPacketHistory
maxAckDelay time.Duration
rttStats *utils.RTTStats
hasNewAck bool // true as soon as we received an ack-eliciting new packet
ackQueued bool // true once we received more than 2 (or later in the connection 10) ack-eliciting packets
@ -33,14 +32,10 @@ type receivedPacketTracker struct {
logger utils.Logger
}
func newReceivedPacketTracker(
rttStats *utils.RTTStats,
logger utils.Logger,
) *receivedPacketTracker {
func newReceivedPacketTracker(logger utils.Logger) *receivedPacketTracker {
return &receivedPacketTracker{
packetHistory: newReceivedPacketHistory(),
maxAckDelay: protocol.MaxAckDelay,
rttStats: rttStats,
logger: logger,
}
}

View file

@ -12,14 +12,10 @@ import (
)
var _ = Describe("Received Packet Tracker", func() {
var (
tracker *receivedPacketTracker
rttStats *utils.RTTStats
)
var tracker *receivedPacketTracker
BeforeEach(func() {
rttStats = &utils.RTTStats{}
tracker = newReceivedPacketTracker(rttStats, utils.DefaultLogger)
tracker = newReceivedPacketTracker(utils.DefaultLogger)
})
Context("accepting packets", func() {