remove MaybeTriggerBlocked from flowController

This commit is contained in:
Lucas Clemente
2016-07-09 18:09:37 +02:00
parent a09de18f56
commit 8dc330f818
2 changed files with 2 additions and 53 deletions

View File

@@ -12,9 +12,8 @@ type flowController struct {
connectionParametersManager *handshake.ConnectionParametersManager
bytesSent protocol.ByteCount
sendFlowControlWindow protocol.ByteCount
lastBlockedSentForOffset protocol.ByteCount
bytesSent protocol.ByteCount
sendFlowControlWindow protocol.ByteCount
bytesRead protocol.ByteCount
highestReceived protocol.ByteCount
@@ -122,28 +121,6 @@ func (c *flowController) AddBytesRead(n protocol.ByteCount) {
c.bytesRead += n
}
// MaybeTriggerBlocked determines if it is necessary to send a Blocked for this stream
// it makes sure that only one Blocked is sent for each offset
func (c *flowController) MaybeTriggerBlocked() bool {
if c.SendWindowSize() != 0 {
return false
}
c.mutex.RLock()
sendFlowControlWindow := c.getSendFlowControlWindow()
c.mutex.RUnlock()
c.mutex.Lock()
defer c.mutex.Unlock()
if c.lastBlockedSentForOffset == sendFlowControlWindow {
return false
}
c.lastBlockedSentForOffset = sendFlowControlWindow
return true
}
// MaybeTriggerWindowUpdate determines if it is necessary to send a WindowUpdate
// if so, it returns true and the offset of the window
func (c *flowController) MaybeTriggerWindowUpdate() (bool, protocol.ByteCount) {