mirror of https://github.com/fatedier/frp.git
close session in login()
This commit is contained in:
parent
30cb0a3ab0
commit
394af08561
|
@ -86,8 +86,6 @@ func (svr *Service) Run() error {
|
||||||
if g.GlbClientCfg.LoginFailExit {
|
if g.GlbClientCfg.LoginFailExit {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
conn.Close()
|
|
||||||
session.Close()
|
|
||||||
time.Sleep(10 * time.Second)
|
time.Sleep(10 * time.Second)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -169,6 +167,9 @@ func (svr *Service) login() (conn frpNet.Conn, session *fmux.Session, err error)
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
conn.Close()
|
conn.Close()
|
||||||
|
if session != nil {
|
||||||
|
session.Close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue