set the offset in BLOCKED and STREAM_BLOCKED frames

This commit is contained in:
Marten Seemann
2017-12-14 15:19:55 +07:00
parent 69998c19cb
commit 00edfb7461
12 changed files with 51 additions and 33 deletions

View File

@@ -79,11 +79,16 @@ func (c *baseFlowController) getWindowUpdate() protocol.ByteCount {
return c.receiveWindow
}
func (c *baseFlowController) IsBlocked() bool {
// IsBlocked says if it is blocked by flow control.
// If it is blocked, the offset is returned.
func (c *baseFlowController) IsBlocked() (bool, protocol.ByteCount) {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.sendWindowSize() == 0
if c.sendWindowSize() != 0 {
return false, 0
}
return true, c.sendWindow
}
// maybeAdjustWindowIncrement increases the receiveWindowIncrement if we're sending updates too often.