From 1aaf049a11ea07713f072acfc89d6dbba32cf0ca Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 8 Feb 2017 10:39:16 +0700 Subject: [PATCH] remove unused GetBytesSent function from flow controller --- flowcontrol/flow_control_manager.go | 11 ----------- flowcontrol/flow_controller.go | 4 ---- flowcontrol/flow_controller_test.go | 5 ----- 3 files changed, 20 deletions(-) diff --git a/flowcontrol/flow_control_manager.go b/flowcontrol/flow_control_manager.go index a8a207df..32d39c97 100644 --- a/flowcontrol/flow_control_manager.go +++ b/flowcontrol/flow_control_manager.go @@ -91,17 +91,6 @@ func (f *flowControlManager) ResetStream(streamID protocol.StreamID, byteOffset 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 // it adds the number of additional bytes to connection level flow control // streamID must not be 0 here diff --git a/flowcontrol/flow_controller.go b/flowcontrol/flow_controller.go index d9cbdd76..0a83cc56 100644 --- a/flowcontrol/flow_controller.go +++ b/flowcontrol/flow_controller.go @@ -66,10 +66,6 @@ func (c *flowController) AddBytesSent(n protocol.ByteCount) { c.bytesSent += n } -func (c *flowController) GetBytesSent() protocol.ByteCount { - return c.bytesSent -} - // UpdateSendWindow should be called after receiving a WindowUpdateFrame // it returns true if the window was actually updated func (c *flowController) UpdateSendWindow(newOffset protocol.ByteCount) bool { diff --git a/flowcontrol/flow_controller_test.go b/flowcontrol/flow_controller_test.go index 75c97eb7..72f6b749 100644 --- a/flowcontrol/flow_controller_test.go +++ b/flowcontrol/flow_controller_test.go @@ -118,11 +118,6 @@ var _ = Describe("Flow controller", func() { 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() { controller.bytesSent = 5 controller.sendWindow = 12