From 3affa1d911bd6f6bbe0f95f9f63b9b79a4794411 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 24 Dec 2022 12:12:36 +1300 Subject: [PATCH] ackhandler: remove unused version parameter from constructor --- connection.go | 2 -- internal/ackhandler/ackhandler.go | 3 +-- internal/ackhandler/received_packet_handler.go | 7 +++---- internal/ackhandler/received_packet_handler_test.go | 1 - internal/ackhandler/received_packet_tracker.go | 4 ---- internal/ackhandler/received_packet_tracker_test.go | 2 +- 6 files changed, 5 insertions(+), 14 deletions(-) diff --git a/connection.go b/connection.go index b5435633..d7930911 100644 --- a/connection.go +++ b/connection.go @@ -296,7 +296,6 @@ var newConnection = func( s.perspective, s.tracer, s.logger, - s.version, ) initialStream := newCryptoStream() handshakeStream := newCryptoStream() @@ -431,7 +430,6 @@ var newClientConnection = func( s.perspective, s.tracer, s.logger, - s.version, ) initialStream := newCryptoStream() handshakeStream := newCryptoStream() diff --git a/internal/ackhandler/ackhandler.go b/internal/ackhandler/ackhandler.go index 2fc9ae4e..abd9f70d 100644 --- a/internal/ackhandler/ackhandler.go +++ b/internal/ackhandler/ackhandler.go @@ -17,8 +17,7 @@ func NewAckHandler( pers protocol.Perspective, tracer logging.ConnectionTracer, logger utils.Logger, - version protocol.VersionNumber, ) (SentPacketHandler, ReceivedPacketHandler) { sph := newSentPacketHandler(initialPacketNumber, initialMaxDatagramSize, rttStats, clientAddressValidated, pers, tracer, logger) - return sph, newReceivedPacketHandler(sph, rttStats, logger, version) + return sph, newReceivedPacketHandler(sph, rttStats, logger) } diff --git a/internal/ackhandler/received_packet_handler.go b/internal/ackhandler/received_packet_handler.go index b233f573..3df78d54 100644 --- a/internal/ackhandler/received_packet_handler.go +++ b/internal/ackhandler/received_packet_handler.go @@ -25,13 +25,12 @@ func newReceivedPacketHandler( sentPackets sentPacketTracker, rttStats *utils.RTTStats, logger utils.Logger, - version protocol.VersionNumber, ) ReceivedPacketHandler { return &receivedPacketHandler{ sentPackets: sentPackets, - initialPackets: newReceivedPacketTracker(rttStats, logger, version), - handshakePackets: newReceivedPacketTracker(rttStats, logger, version), - appDataPackets: newReceivedPacketTracker(rttStats, logger, version), + initialPackets: newReceivedPacketTracker(rttStats, logger), + handshakePackets: newReceivedPacketTracker(rttStats, logger), + appDataPackets: newReceivedPacketTracker(rttStats, logger), lowest1RTTPacket: protocol.InvalidPacketNumber, } } diff --git a/internal/ackhandler/received_packet_handler_test.go b/internal/ackhandler/received_packet_handler_test.go index be78ff13..acc87466 100644 --- a/internal/ackhandler/received_packet_handler_test.go +++ b/internal/ackhandler/received_packet_handler_test.go @@ -23,7 +23,6 @@ var _ = Describe("Received Packet Handler", func() { sentPackets, &utils.RTTStats{}, utils.DefaultLogger, - protocol.VersionWhatever, ) }) diff --git a/internal/ackhandler/received_packet_tracker.go b/internal/ackhandler/received_packet_tracker.go index 0bd5ff88..f5693b48 100644 --- a/internal/ackhandler/received_packet_tracker.go +++ b/internal/ackhandler/received_packet_tracker.go @@ -31,21 +31,17 @@ type receivedPacketTracker struct { lastAck *wire.AckFrame logger utils.Logger - - version protocol.VersionNumber } func newReceivedPacketTracker( rttStats *utils.RTTStats, logger utils.Logger, - version protocol.VersionNumber, ) *receivedPacketTracker { return &receivedPacketTracker{ packetHistory: newReceivedPacketHistory(), maxAckDelay: protocol.MaxAckDelay, rttStats: rttStats, logger: logger, - version: version, } } diff --git a/internal/ackhandler/received_packet_tracker_test.go b/internal/ackhandler/received_packet_tracker_test.go index 5f035388..17ebc5f2 100644 --- a/internal/ackhandler/received_packet_tracker_test.go +++ b/internal/ackhandler/received_packet_tracker_test.go @@ -19,7 +19,7 @@ var _ = Describe("Received Packet Tracker", func() { BeforeEach(func() { rttStats = &utils.RTTStats{} - tracker = newReceivedPacketTracker(rttStats, utils.DefaultLogger, protocol.VersionWhatever) + tracker = newReceivedPacketTracker(rttStats, utils.DefaultLogger) }) Context("accepting packets", func() {