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:
@@ -4,7 +4,6 @@ import (
|
||||
"sync"
|
||||
"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"
|
||||
)
|
||||
@@ -25,7 +24,7 @@ type baseFlowController struct {
|
||||
|
||||
epochStartTime time.Time
|
||||
epochStartOffset protocol.ByteCount
|
||||
rttStats *congestion.RTTStats
|
||||
rttStats *utils.RTTStats
|
||||
|
||||
logger utils.Logger
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
@@ -27,7 +28,7 @@ var _ = Describe("Base Flow controller", func() {
|
||||
|
||||
BeforeEach(func() {
|
||||
controller = &baseFlowController{}
|
||||
controller.rttStats = &congestion.RTTStats{}
|
||||
controller.rttStats = &utils.RTTStats{}
|
||||
})
|
||||
|
||||
Context("send flow control", func() {
|
||||
|
||||
@@ -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/qerr"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
@@ -24,7 +23,7 @@ func NewConnectionFlowController(
|
||||
receiveWindow protocol.ByteCount,
|
||||
maxReceiveWindow protocol.ByteCount,
|
||||
queueWindowUpdate func(),
|
||||
rttStats *congestion.RTTStats,
|
||||
rttStats *utils.RTTStats,
|
||||
logger utils.Logger,
|
||||
) ConnectionFlowController {
|
||||
return &connectionFlowController{
|
||||
|
||||
@@ -3,7 +3,6 @@ package flowcontrol
|
||||
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/onsi/ginkgo"
|
||||
@@ -25,13 +24,13 @@ var _ = Describe("Connection Flow controller", func() {
|
||||
BeforeEach(func() {
|
||||
queuedWindowUpdate = false
|
||||
controller = &connectionFlowController{}
|
||||
controller.rttStats = &congestion.RTTStats{}
|
||||
controller.rttStats = &utils.RTTStats{}
|
||||
controller.logger = utils.DefaultLogger
|
||||
controller.queueWindowUpdate = func() { queuedWindowUpdate = true }
|
||||
})
|
||||
|
||||
Context("Constructor", func() {
|
||||
rttStats := &congestion.RTTStats{}
|
||||
rttStats := &utils.RTTStats{}
|
||||
|
||||
It("sets the send and receive windows", func() {
|
||||
receiveWindow := protocol.ByteCount(2000)
|
||||
|
||||
@@ -3,7 +3,6 @@ package flowcontrol
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/congestion"
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/qerr"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
@@ -31,7 +30,7 @@ func NewStreamFlowController(
|
||||
maxReceiveWindow protocol.ByteCount,
|
||||
initialSendWindow protocol.ByteCount,
|
||||
queueWindowUpdate func(protocol.StreamID),
|
||||
rttStats *congestion.RTTStats,
|
||||
rttStats *utils.RTTStats,
|
||||
logger utils.Logger,
|
||||
) StreamFlowController {
|
||||
return &streamFlowController{
|
||||
|
||||
@@ -3,7 +3,6 @@ package flowcontrol
|
||||
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/onsi/ginkgo"
|
||||
@@ -18,7 +17,7 @@ var _ = Describe("Stream Flow controller", func() {
|
||||
|
||||
BeforeEach(func() {
|
||||
queuedWindowUpdate = false
|
||||
rttStats := &congestion.RTTStats{}
|
||||
rttStats := &utils.RTTStats{}
|
||||
controller = &streamFlowController{
|
||||
streamID: 10,
|
||||
connection: NewConnectionFlowController(1000, 1000, func() {}, rttStats, utils.DefaultLogger).(*connectionFlowController),
|
||||
@@ -30,7 +29,7 @@ var _ = Describe("Stream Flow controller", func() {
|
||||
})
|
||||
|
||||
Context("Constructor", func() {
|
||||
rttStats := &congestion.RTTStats{}
|
||||
rttStats := &utils.RTTStats{}
|
||||
receiveWindow := protocol.ByteCount(2000)
|
||||
maxReceiveWindow := protocol.ByteCount(3000)
|
||||
sendWindow := protocol.ByteCount(4000)
|
||||
|
||||
Reference in New Issue
Block a user