close session in login()

This commit is contained in:
fatedier 2019-08-03 16:43:21 +08:00
parent 30cb0a3ab0
commit 394af08561
1 changed files with 3 additions and 2 deletions

View File

@ -86,8 +86,6 @@ func (svr *Service) Run() error {
if g.GlbClientCfg.LoginFailExit {
return err
} else {
conn.Close()
session.Close()
time.Sleep(10 * time.Second)
}
} else {
@ -169,6 +167,9 @@ func (svr *Service) login() (conn frpNet.Conn, session *fmux.Session, err error)
defer func() {
if err != nil {
conn.Close()
if session != nil {
session.Close()
}
}
}()