forked from quic-go/quic-go
committed by
Lucas Clemente
parent
543ce21a5a
commit
15352e9591
@@ -180,3 +180,17 @@ func (m *streamsMap) NumberOfStreams() int {
|
||||
m.mutex.RUnlock()
|
||||
return n
|
||||
}
|
||||
|
||||
// garbageCollectClosedStreams deletes nil values in the streams if they are smaller than protocol.MaxNewStreamIDDelta than the highest stream opened by the client
|
||||
func (m *streamsMap) garbageCollectClosedStreams() {
|
||||
m.mutex.Lock()
|
||||
for id, str := range m.streams {
|
||||
if str != nil {
|
||||
continue
|
||||
}
|
||||
if id+protocol.MaxNewStreamIDDelta <= m.highestStreamOpenedByClient {
|
||||
delete(m.streams, id)
|
||||
}
|
||||
}
|
||||
m.mutex.Unlock()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user