Update comment

pull/138/head
Andy Wang 4 years ago
parent ebce40ce2d
commit 39c06a6e1d
No known key found for this signature in database
GPG Key ID: 181B49F9F38F3374

@ -195,7 +195,9 @@ func (sesh *Session) closeStream(s *Stream, active bool) error {
log.Tracef("stream %v passively closed", s.id)
}
// id may or may not exist as this is user input, if we use Delete(s.id) here it will panic
// We set it as nil to signify that the stream id had existed before.
// If we Delete(s.id) straight away, later on in recvDataFromRemote, it will not be able to tell
// if the frame it received was from a new stream or a dying stream whose frame arrived late
sesh.streams.Store(s.id, nil)
if sesh.streamCountDecr() == 0 {
if sesh.Singleplex {

@ -237,8 +237,9 @@ func TestRecvDataFromRemote_Closing_InOrder(t *testing.T) {
if s1I != nil {
t.Error("stream 1 exists after receiving stream close for the second time")
}
if sesh.streamCount() != 1 {
t.Error("stream count isn't 1 after stream 1 closed twice")
streamCount := sesh.streamCount()
if streamCount != 1 {
t.Errorf("stream count is %v after stream 1 closed twice, expected 1", streamCount)
}
// close session

Loading…
Cancel
Save