only iterate over open Streams in StreamsMap

ref #256
This commit is contained in:
Marten Seemann
2016-08-06 14:41:47 +07:00
parent b0d116ad5a
commit 1a30313ace
2 changed files with 11 additions and 11 deletions

View File

@@ -450,9 +450,6 @@ func (s *Session) closeStreamsWithError(err error) {
defer s.streamsMutex.Unlock()
fn := func(str *stream) (bool, error) {
if str == nil {
return true, nil
}
s.closeStreamWithError(str, err)
return true, nil
}
@@ -644,9 +641,6 @@ func (s *Session) newStreamImpl(id protocol.StreamID) (*stream, error) {
// from the streams map.
func (s *Session) garbageCollectStreams() {
fn := func(str *stream) (bool, error) {
if str == nil {
return true, nil
}
id := str.StreamID()
if str.finished() {
atomic.AddUint32(&s.openStreamsCount, ^uint32(0)) // decrement
@@ -697,10 +691,6 @@ func (s *Session) getWindowUpdateFrames() ([]*frames.WindowUpdateFrame, error) {
var res []*frames.WindowUpdateFrame
fn := func(str *stream) (bool, error) {
if str == nil {
return true, nil
}
id := str.StreamID()
doUpdate, offset, err := s.flowControlManager.MaybeTriggerStreamWindowUpdate(id)
if err != nil {