forked from quic-go/quic-go
introduce a sentinel ByteCount value
This commit is contained in:
@@ -30,9 +30,9 @@ var _ = Describe("Stream Flow controller", func() {
|
|||||||
|
|
||||||
Context("Constructor", func() {
|
Context("Constructor", func() {
|
||||||
rttStats := &utils.RTTStats{}
|
rttStats := &utils.RTTStats{}
|
||||||
receiveWindow := protocol.ByteCount(2000)
|
const receiveWindow protocol.ByteCount = 2000
|
||||||
maxReceiveWindow := protocol.ByteCount(3000)
|
const maxReceiveWindow protocol.ByteCount = 3000
|
||||||
sendWindow := protocol.ByteCount(4000)
|
const sendWindow protocol.ByteCount = 4000
|
||||||
|
|
||||||
It("sets the send and receive windows", func() {
|
It("sets the send and receive windows", func() {
|
||||||
cc := NewConnectionFlowController(0, 0, nil, nil, utils.DefaultLogger)
|
cc := NewConnectionFlowController(0, 0, nil, nil, utils.DefaultLogger)
|
||||||
@@ -50,7 +50,7 @@ var _ = Describe("Stream Flow controller", func() {
|
|||||||
queued = true
|
queued = true
|
||||||
}
|
}
|
||||||
|
|
||||||
cc := NewConnectionFlowController(0, 0, nil, nil, utils.DefaultLogger)
|
cc := NewConnectionFlowController(receiveWindow, maxReceiveWindow, func() {}, nil, utils.DefaultLogger)
|
||||||
fc := NewStreamFlowController(5, cc, receiveWindow, maxReceiveWindow, sendWindow, queueWindowUpdate, rttStats, utils.DefaultLogger).(*streamFlowController)
|
fc := NewStreamFlowController(5, cc, receiveWindow, maxReceiveWindow, sendWindow, queueWindowUpdate, rttStats, utils.DefaultLogger).(*streamFlowController)
|
||||||
fc.AddBytesRead(receiveWindow)
|
fc.AddBytesRead(receiveWindow)
|
||||||
Expect(queued).To(BeTrue())
|
Expect(queued).To(BeTrue())
|
||||||
|
|||||||
@@ -44,11 +44,14 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// A ByteCount in QUIC
|
// A ByteCount in QUIC
|
||||||
type ByteCount uint64
|
type ByteCount int64
|
||||||
|
|
||||||
// MaxByteCount is the maximum value of a ByteCount
|
// MaxByteCount is the maximum value of a ByteCount
|
||||||
const MaxByteCount = ByteCount(1<<62 - 1)
|
const MaxByteCount = ByteCount(1<<62 - 1)
|
||||||
|
|
||||||
|
// InvalidByteCount is an invalid byte count
|
||||||
|
const InvalidByteCount ByteCount = -1
|
||||||
|
|
||||||
// An ApplicationErrorCode is an application-defined error code.
|
// An ApplicationErrorCode is an application-defined error code.
|
||||||
type ApplicationErrorCode uint64
|
type ApplicationErrorCode uint64
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user