delete flow controllers for closed streams

fixes #177
This commit is contained in:
Lucas Clemente
2016-07-28 16:45:55 +02:00
parent 5a82b35ca8
commit 3a88a8cffa
6 changed files with 26 additions and 1 deletions

View File

@@ -51,6 +51,14 @@ func (f *flowControlManager) NewStream(streamID protocol.StreamID, contributesTo
f.contributesToConnectionFlowControl[streamID] = contributesToConnectionFlow
}
// RemoveStream removes a closed stream from flow control
func (f *flowControlManager) RemoveStream(streamID protocol.StreamID) {
f.mutex.Lock()
delete(f.streamFlowController, streamID)
delete(f.contributesToConnectionFlowControl, streamID)
f.mutex.Unlock()
}
// 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