forked from quic-go/quic-go
move the RTTStats to the utils package
The RTTStats are used by the logging package. In order to instrument the congestion package, the RTTStats can't be part of that package any more (to avoid an import loop).
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package ackhandler
|
||||
|
||||
import (
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/lucas-clemente/quic-go/logging"
|
||||
@@ -11,7 +10,7 @@ import (
|
||||
// NewAckHandler creates a new SentPacketHandler and a new ReceivedPacketHandler
|
||||
func NewAckHandler(
|
||||
initialPacketNumber protocol.PacketNumber,
|
||||
rttStats *congestion.RTTStats,
|
||||
rttStats *utils.RTTStats,
|
||||
pers protocol.Perspective,
|
||||
traceCallback func(quictrace.Event),
|
||||
tracer logging.ConnectionTracer,
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/lucas-clemente/quic-go/internal/wire"
|
||||
@@ -45,7 +44,7 @@ var _ ReceivedPacketHandler = &receivedPacketHandler{}
|
||||
|
||||
func newReceivedPacketHandler(
|
||||
sentPackets sentPacketTracker,
|
||||
rttStats *congestion.RTTStats,
|
||||
rttStats *utils.RTTStats,
|
||||
logger utils.Logger,
|
||||
version protocol.VersionNumber,
|
||||
) ReceivedPacketHandler {
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/lucas-clemente/quic-go/internal/wire"
|
||||
@@ -22,7 +21,7 @@ var _ = Describe("Received Packet Handler", func() {
|
||||
sentPackets = NewMockSentPacketTracker(mockCtrl)
|
||||
handler = newReceivedPacketHandler(
|
||||
sentPackets,
|
||||
&congestion.RTTStats{},
|
||||
&utils.RTTStats{},
|
||||
utils.DefaultLogger,
|
||||
protocol.VersionWhatever,
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@ package ackhandler
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/lucas-clemente/quic-go/internal/wire"
|
||||
@@ -17,7 +16,7 @@ type receivedPacketTracker struct {
|
||||
packetHistory *receivedPacketHistory
|
||||
|
||||
maxAckDelay time.Duration
|
||||
rttStats *congestion.RTTStats
|
||||
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
|
||||
@@ -32,7 +31,7 @@ type receivedPacketTracker struct {
|
||||
}
|
||||
|
||||
func newReceivedPacketTracker(
|
||||
rttStats *congestion.RTTStats,
|
||||
rttStats *utils.RTTStats,
|
||||
logger utils.Logger,
|
||||
version protocol.VersionNumber,
|
||||
) *receivedPacketTracker {
|
||||
|
||||
@@ -3,7 +3,6 @@ package ackhandler
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/lucas-clemente/quic-go/internal/wire"
|
||||
@@ -15,11 +14,11 @@ import (
|
||||
var _ = Describe("Received Packet Tracker", func() {
|
||||
var (
|
||||
tracker *receivedPacketTracker
|
||||
rttStats *congestion.RTTStats
|
||||
rttStats *utils.RTTStats
|
||||
)
|
||||
|
||||
BeforeEach(func() {
|
||||
rttStats = &congestion.RTTStats{}
|
||||
rttStats = &utils.RTTStats{}
|
||||
tracker = newReceivedPacketTracker(rttStats, utils.DefaultLogger, protocol.VersionWhatever)
|
||||
})
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ type sentPacketHandler struct {
|
||||
bytesInFlight protocol.ByteCount
|
||||
|
||||
congestion congestion.SendAlgorithmWithDebugInfos
|
||||
rttStats *congestion.RTTStats
|
||||
rttStats *utils.RTTStats
|
||||
|
||||
// The number of times a PTO has been sent without receiving an ack.
|
||||
ptoCount uint32
|
||||
@@ -93,7 +93,7 @@ var _ sentPacketTracker = &sentPacketHandler{}
|
||||
|
||||
func newSentPacketHandler(
|
||||
initialPacketNumber protocol.PacketNumber,
|
||||
rttStats *congestion.RTTStats,
|
||||
rttStats *utils.RTTStats,
|
||||
pers protocol.Perspective,
|
||||
traceCallback func(quictrace.Event),
|
||||
tracer logging.ConnectionTracer,
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/mocks"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
@@ -27,7 +26,7 @@ var _ = Describe("SentPacketHandler", func() {
|
||||
|
||||
JustBeforeEach(func() {
|
||||
lostPackets = nil
|
||||
rttStats := &congestion.RTTStats{}
|
||||
rttStats := &utils.RTTStats{}
|
||||
handler = newSentPacketHandler(42, rttStats, perspective, nil, nil, utils.DefaultLogger)
|
||||
streamFrame = wire.StreamFrame{
|
||||
StreamID: 5,
|
||||
|
||||
Reference in New Issue
Block a user