mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-15 18:13:29 +00:00
add comments
This commit is contained in:
parent
db8dd19c9d
commit
47410dbb97
@ -172,7 +172,7 @@ func (sesh *Session) closeStream(s *Stream, active bool) error {
|
|||||||
log.Tracef("stream %v passively closed", s.id)
|
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 {
|
if sesh.streamCountDecr() == 0 {
|
||||||
log.Debugf("session %v has no active stream left", sesh.id)
|
log.Debugf("session %v has no active stream left", sesh.id)
|
||||||
go sesh.timeoutAfter(30 * time.Second)
|
go sesh.timeoutAfter(30 * time.Second)
|
||||||
@ -205,6 +205,7 @@ func (sesh *Session) recvDataFromRemote(data []byte) error {
|
|||||||
}
|
}
|
||||||
return existingStreamI.(*Stream).writeFrame(*frame)
|
return existingStreamI.(*Stream).writeFrame(*frame)
|
||||||
} else {
|
} else {
|
||||||
|
// new stream
|
||||||
sesh.streamCountIncr()
|
sesh.streamCountIncr()
|
||||||
sesh.acceptCh <- newStream
|
sesh.acceptCh <- newStream
|
||||||
return newStream.writeFrame(*frame)
|
return newStream.writeFrame(*frame)
|
||||||
|
Loading…
Reference in New Issue
Block a user