Lexical changes

This commit is contained in:
Qian Wang 2018-12-30 00:28:38 +00:00
parent deb5271cef
commit 1cb7bff8b3
2 changed files with 5 additions and 3 deletions

View File

@ -39,7 +39,7 @@ type Session struct {
acceptCh chan *Stream acceptCh chan *Stream
die chan struct{} die chan struct{}
overdose sync.Once // fentanyl? beware of respiratory depression suicide sync.Once
} }
// 1 conn is needed to make a session // 1 conn is needed to make a session
@ -146,7 +146,7 @@ func (sesh *Session) addStream(id uint32) *Stream {
func (sesh *Session) Close() error { func (sesh *Session) Close() error {
// Because closing a closed channel causes panic // Because closing a closed channel causes panic
sesh.overdose.Do(func() { close(sesh.die) }) sesh.suicide.Do(func() { close(sesh.die) })
sesh.streamsM.Lock() sesh.streamsM.Lock()
for id, stream := range sesh.streams { for id, stream := range sesh.streams {
// If we call stream.Close() here, streamsM will result in a deadlock // If we call stream.Close() here, streamsM will result in a deadlock

View File

@ -13,6 +13,8 @@ import (
// FIXME: sanity checks. The server may panic due to user input // FIXME: sanity checks. The server may panic due to user input
// TODO: manual backup
/* /*
0 reserved 0 reserved
1 listActiveUsers none []uids 1 listActiveUsers none []uids