mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-17 15:25:30 +00:00
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()
|
sesh.streamsM.Lock()
|
||||||
if len(sesh.streams) == 0 && !sesh.IsBroken() {
|
if len(sesh.streams) == 0 && !sesh.IsBroken() {
|
||||||
sesh.streamsM.Unlock()
|
sesh.streamsM.Unlock()
|
||||||
|
sesh.SetTerminalMsg("timeout")
|
||||||
sesh.Close()
|
sesh.Close()
|
||||||
} else {
|
} else {
|
||||||
sesh.streamsM.Unlock()
|
sesh.streamsM.Unlock()
|
||||||
|
@ -105,6 +105,7 @@ func (sb *switchboard) removeConn(closing *connEnclave) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(sb.ces) == 0 {
|
if len(sb.ces) == 0 {
|
||||||
|
sb.session.SetTerminalMsg("no underlying connection left")
|
||||||
sb.session.Close()
|
sb.session.Close()
|
||||||
}
|
}
|
||||||
sb.cesM.Unlock()
|
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) {
|
func (u *ActiveUser) Terminate(reason string) {
|
||||||
u.sessionsM.Lock()
|
u.sessionsM.Lock()
|
||||||
for _, sesh := range u.sessions {
|
for _, sesh := range u.sessions {
|
||||||
|
Loading…
Reference in New Issue
Block a user