From 47410dbb976632236884a872268124b8706118ce Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Sun, 15 Mar 2020 23:56:45 +0000 Subject: [PATCH] add comments --- internal/multiplex/session.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/multiplex/session.go b/internal/multiplex/session.go index 6dfa8a8..8fe2f6f 100644 --- a/internal/multiplex/session.go +++ b/internal/multiplex/session.go @@ -172,7 +172,7 @@ func (sesh *Session) closeStream(s *Stream, active bool) error { log.Tracef("stream %v passively closed", s.id) } - sesh.streams.Store(s.id, nil) + sesh.streams.Store(s.id, nil) // id may or may not exist. if we use Delete(s.id) here it will panic if sesh.streamCountDecr() == 0 { log.Debugf("session %v has no active stream left", sesh.id) go sesh.timeoutAfter(30 * time.Second) @@ -205,6 +205,7 @@ func (sesh *Session) recvDataFromRemote(data []byte) error { } return existingStreamI.(*Stream).writeFrame(*frame) } else { + // new stream sesh.streamCountIncr() sesh.acceptCh <- newStream return newStream.writeFrame(*frame)