mirror of https://github.com/cbeuw/Cloak
Add terminal messages upon session closing
This commit is contained in:
parent
0695f9df13
commit
8f9922b06b
|
|
@ -173,6 +173,7 @@ func (sesh *Session) timeoutAfter(to time.Duration) {
|
|||
sesh.streamsM.Lock()
|
||||
if len(sesh.streams) == 0 && !sesh.IsBroken() {
|
||||
sesh.streamsM.Unlock()
|
||||
sesh.SetTerminalMsg("timeout")
|
||||
sesh.Close()
|
||||
} else {
|
||||
sesh.streamsM.Unlock()
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ func (sb *switchboard) removeConn(closing *connEnclave) {
|
|||
}
|
||||
}
|
||||
if len(sb.ces) == 0 {
|
||||
sb.session.SetTerminalMsg("no underlying connection left")
|
||||
sb.session.Close()
|
||||
}
|
||||
sb.cesM.Unlock()
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ func (u *ActiveUser) GetSession(sessionID uint32, obfs mux.Obfser, deobfs mux.De
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: allow message to pass through this and sesh.Close()
|
||||
func (u *ActiveUser) Terminate(reason string) {
|
||||
u.sessionsM.Lock()
|
||||
for _, sesh := range u.sessions {
|
||||
|
|
|
|||
Loading…
Reference in New Issue