add methods for sending data to FlowControlManager

This commit is contained in:
Marten Seemann
2016-06-16 10:55:34 +07:00
committed by Lucas Clemente
parent 9336245ddd
commit ac54ac66c7
6 changed files with 155 additions and 4 deletions

View File

@@ -73,6 +73,7 @@ func (c *flowController) UpdateSendWindow(newOffset protocol.ByteCount) bool {
return false
}
// TODO: remove once the Stream doesn't use it anymore
func (c *flowController) SendWindowSize() protocol.ByteCount {
c.mutex.RLock()
defer c.mutex.RUnlock()
@@ -85,6 +86,13 @@ func (c *flowController) SendWindowSize() protocol.ByteCount {
return sendFlowControlWindow - c.bytesSent
}
func (c *flowController) SendWindowOffset() protocol.ByteCount {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.getSendFlowControlWindow()
}
// UpdateHighestReceived updates the highestReceived value, if the byteOffset is higher
// Should **only** be used for the stream-level FlowController
func (c *flowController) UpdateHighestReceived(byteOffset protocol.ByteCount) protocol.ByteCount {