forked from quic-go/quic-go
remove unused GetBytesSent function from flow controller
This commit is contained in:
@@ -91,17 +91,6 @@ func (f *flowControlManager) ResetStream(streamID protocol.StreamID, byteOffset
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *flowControlManager) GetBytesSent(streamID protocol.StreamID) (protocol.ByteCount, error) {
|
|
||||||
f.mutex.Lock()
|
|
||||||
defer f.mutex.Unlock()
|
|
||||||
|
|
||||||
fc, err := f.getFlowController(streamID)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
return fc.GetBytesSent(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateHighestReceived updates the highest received byte offset for a stream
|
// UpdateHighestReceived updates the highest received byte offset for a stream
|
||||||
// it adds the number of additional bytes to connection level flow control
|
// it adds the number of additional bytes to connection level flow control
|
||||||
// streamID must not be 0 here
|
// streamID must not be 0 here
|
||||||
|
|||||||
@@ -66,10 +66,6 @@ func (c *flowController) AddBytesSent(n protocol.ByteCount) {
|
|||||||
c.bytesSent += n
|
c.bytesSent += n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *flowController) GetBytesSent() protocol.ByteCount {
|
|
||||||
return c.bytesSent
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateSendWindow should be called after receiving a WindowUpdateFrame
|
// UpdateSendWindow should be called after receiving a WindowUpdateFrame
|
||||||
// it returns true if the window was actually updated
|
// it returns true if the window was actually updated
|
||||||
func (c *flowController) UpdateSendWindow(newOffset protocol.ByteCount) bool {
|
func (c *flowController) UpdateSendWindow(newOffset protocol.ByteCount) bool {
|
||||||
|
|||||||
@@ -118,11 +118,6 @@ var _ = Describe("Flow controller", func() {
|
|||||||
Expect(controller.bytesSent).To(Equal(protocol.ByteCount(5 + 6)))
|
Expect(controller.bytesSent).To(Equal(protocol.ByteCount(5 + 6)))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets the bytesSent", func() {
|
|
||||||
controller.bytesSent = 8
|
|
||||||
Expect(controller.GetBytesSent()).To(Equal(protocol.ByteCount(8)))
|
|
||||||
})
|
|
||||||
|
|
||||||
It("gets the size of the remaining flow control window", func() {
|
It("gets the size of the remaining flow control window", func() {
|
||||||
controller.bytesSent = 5
|
controller.bytesSent = 5
|
||||||
controller.sendWindow = 12
|
controller.sendWindow = 12
|
||||||
|
|||||||
Reference in New Issue
Block a user