From 394af0856199f74a829aee274706e1b7b38d3df0 Mon Sep 17 00:00:00 2001 From: fatedier Date: Sat, 3 Aug 2019 16:43:21 +0800 Subject: [PATCH] close session in login() --- client/service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/service.go b/client/service.go index 007e21d1..f21be4fe 100644 --- a/client/service.go +++ b/client/service.go @@ -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() + } } }()