fix handling of connection level window updates

This commit is contained in:
Lucas Clemente
2016-07-08 13:54:27 +02:00
parent 3cbf16b66f
commit 5cc88f60dc

View File

@@ -344,8 +344,10 @@ func (s *Session) isValidStreamID(streamID protocol.StreamID) bool {
func (s *Session) handleWindowUpdateFrame(frame *frames.WindowUpdateFrame) error {
s.streamsMutex.RLock()
defer s.streamsMutex.RUnlock()
if s, ok := s.streams[frame.StreamID]; ok && s == nil {
return errWindowUpdateOnClosedStream
if frame.StreamID != 0 {
if s, ok := s.streams[frame.StreamID]; ok && s == nil {
return errWindowUpdateOnClosedStream
}
}
_, err := s.flowControlManager.UpdateWindow(frame.StreamID, frame.ByteOffset)
return err