From f65677385865813dac6440293fd551525b21cd26 Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Thu, 12 Jul 2018 13:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=99=BA=E8=83=BD=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/http/http.go | 4 +++- services/socks/socks.go | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/services/http/http.go b/services/http/http.go index 73dd4b5..efdde0d 100644 --- a/services/http/http.go +++ b/services/http/http.go @@ -189,7 +189,9 @@ func (s *HTTP) StopService() { } }() s.isStop = true - s.checker.Stop() + if *s.cfg.Parent != "" { + s.checker.Stop() + } if s.sshClient != nil { s.sshClient.Close() } diff --git a/services/socks/socks.go b/services/socks/socks.go index 901e001..0eca018 100644 --- a/services/socks/socks.go +++ b/services/socks/socks.go @@ -146,7 +146,9 @@ func (s *Socks) InitService() (err error) { if *s.cfg.DNSAddress != "" { (*s).domainResolver = utils.NewDomainResolver(*s.cfg.DNSAddress, *s.cfg.DNSTTL, s.log) } - s.checker = utils.NewChecker(*s.cfg.Timeout, int64(*s.cfg.Interval), *s.cfg.Blocked, *s.cfg.Direct, s.log) + if *s.cfg.Parent != "" { + s.checker = utils.NewChecker(*s.cfg.Timeout, int64(*s.cfg.Interval), *s.cfg.Blocked, *s.cfg.Direct, s.log) + } if *s.cfg.ParentType == "ssh" { e := s.ConnectSSH() if e != nil { @@ -193,7 +195,9 @@ func (s *Socks) StopService() { } }() s.isStop = true - s.checker.Stop() + if *s.cfg.Parent != "" { + s.checker.Stop() + } if s.sshClient != nil { s.sshClient.Close() }