Skip to content

Commit

Permalink
use ErrStreamReset for resetting streams
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Nov 20, 2024
1 parent 3eaea39 commit 39abe7e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,14 @@ func (s *Session) close(shutdownErr error, sendGoAway bool, errCode uint32) erro
<-s.sendDoneCh
<-s.recvDoneCh

resetErr := shutdownErr
if _, ok := resetErr.(*GoAwayError); !ok {
resetErr = fmt.Errorf("%w: connection closed: %w", ErrStreamReset, shutdownErr)
}
s.streamLock.Lock()
defer s.streamLock.Unlock()
for id, stream := range s.streams {
stream.forceClose(s.shutdownErr)
stream.forceClose(resetErr)
delete(s.streams, id)
stream.memorySpan.Done()
}
Expand Down

0 comments on commit 39abe7e

Please sign in to comment.