mirror of https://github.com/cbeuw/Cloak
Lexical changes
This commit is contained in:
parent
deb5271cef
commit
1cb7bff8b3
|
|
@ -38,8 +38,8 @@ type Session struct {
|
||||||
// For accepting new streams
|
// For accepting new streams
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue