mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
remove unused RTTStats from the received packet handler (#4287)
This commit is contained in:
parent
be4838bd64
commit
d330d2e30d
5 changed files with 9 additions and 26 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue