forked from quic-go/quic-go
remove MaybeTriggerBlocked from flowController
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user