ackhandler: remove unused version parameter from constructor

This commit is contained in:
Marten Seemann 2022-12-24 12:12:36 +13:00
parent 576d85cd3d
commit 3affa1d911
6 changed files with 5 additions and 14 deletions

View file

@ -296,7 +296,6 @@ var newConnection = func(
s.perspective, s.perspective,
s.tracer, s.tracer,
s.logger, s.logger,
s.version,
) )
initialStream := newCryptoStream() initialStream := newCryptoStream()
handshakeStream := newCryptoStream() handshakeStream := newCryptoStream()
@ -431,7 +430,6 @@ var newClientConnection = func(
s.perspective, s.perspective,
s.tracer, s.tracer,
s.logger, s.logger,
s.version,
) )
initialStream := newCryptoStream() initialStream := newCryptoStream()
handshakeStream := newCryptoStream() handshakeStream := newCryptoStream()

View file

@ -17,8 +17,7 @@ func NewAckHandler(
pers protocol.Perspective, pers protocol.Perspective,
tracer logging.ConnectionTracer, tracer logging.ConnectionTracer,
logger utils.Logger, logger utils.Logger,
version protocol.VersionNumber,
) (SentPacketHandler, ReceivedPacketHandler) { ) (SentPacketHandler, ReceivedPacketHandler) {
sph := newSentPacketHandler(initialPacketNumber, initialMaxDatagramSize, rttStats, clientAddressValidated, pers, tracer, logger) sph := newSentPacketHandler(initialPacketNumber, initialMaxDatagramSize, rttStats, clientAddressValidated, pers, tracer, logger)
return sph, newReceivedPacketHandler(sph, rttStats, logger, version) return sph, newReceivedPacketHandler(sph, rttStats, logger)
} }

View file

@ -25,13 +25,12 @@ func newReceivedPacketHandler(
sentPackets sentPacketTracker, sentPackets sentPacketTracker,
rttStats *utils.RTTStats, rttStats *utils.RTTStats,
logger utils.Logger, logger utils.Logger,
version protocol.VersionNumber,
) ReceivedPacketHandler { ) ReceivedPacketHandler {
return &receivedPacketHandler{ return &receivedPacketHandler{
sentPackets: sentPackets, sentPackets: sentPackets,
initialPackets: newReceivedPacketTracker(rttStats, logger, version), initialPackets: newReceivedPacketTracker(rttStats, logger),
handshakePackets: newReceivedPacketTracker(rttStats, logger, version), handshakePackets: newReceivedPacketTracker(rttStats, logger),
appDataPackets: newReceivedPacketTracker(rttStats, logger, version), appDataPackets: newReceivedPacketTracker(rttStats, logger),
lowest1RTTPacket: protocol.InvalidPacketNumber, lowest1RTTPacket: protocol.InvalidPacketNumber,
} }
} }

View file

@ -23,7 +23,6 @@ var _ = Describe("Received Packet Handler", func() {
sentPackets, sentPackets,
&utils.RTTStats{}, &utils.RTTStats{},
utils.DefaultLogger, utils.DefaultLogger,
protocol.VersionWhatever,
) )
}) })

View file

@ -31,21 +31,17 @@ type receivedPacketTracker struct {
lastAck *wire.AckFrame lastAck *wire.AckFrame
logger utils.Logger logger utils.Logger
version protocol.VersionNumber
} }
func newReceivedPacketTracker( func newReceivedPacketTracker(
rttStats *utils.RTTStats, rttStats *utils.RTTStats,
logger utils.Logger, logger utils.Logger,
version protocol.VersionNumber,
) *receivedPacketTracker { ) *receivedPacketTracker {
return &receivedPacketTracker{ return &receivedPacketTracker{
packetHistory: newReceivedPacketHistory(), packetHistory: newReceivedPacketHistory(),
maxAckDelay: protocol.MaxAckDelay, maxAckDelay: protocol.MaxAckDelay,
rttStats: rttStats, rttStats: rttStats,
logger: logger, logger: logger,
version: version,
} }
} }

View file

@ -19,7 +19,7 @@ var _ = Describe("Received Packet Tracker", func() {
BeforeEach(func() { BeforeEach(func() {
rttStats = &utils.RTTStats{} rttStats = &utils.RTTStats{}
tracker = newReceivedPacketTracker(rttStats, utils.DefaultLogger, protocol.VersionWhatever) tracker = newReceivedPacketTracker(rttStats, utils.DefaultLogger)
}) })
Context("accepting packets", func() { Context("accepting packets", func() {