fix: remove conections on session end
This commit is contained in:
parent
f11887ab0e
commit
43b052daab
1
main.go
1
main.go
|
@ -129,6 +129,7 @@ func (srv *server) newSession(ctx context.Context) func(ssh.Session) {
|
||||||
|
|
||||||
<-ctx.Done()
|
<-ctx.Done()
|
||||||
|
|
||||||
|
srv.ports.Delete(s.User())
|
||||||
if _, err := fmt.Fprintf(s, "Goodbye! %s\n", s.User()); err != nil {
|
if _, err := fmt.Fprintf(s, "Goodbye! %s\n", s.User()); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user