From 421e72188bcf48f88bd2e3d786832e2cff22a9ee Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Fri, 19 Oct 2018 16:35:45 +0800 Subject: [PATCH] a --- CHANGELOG | 1 + config.go | 15 ++++++++------- main.go | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c99396b..1a94b9c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ proxy更新日志 v6.4 1.http(s)代理增加了--jumper参数,可以穿透外部代理连接上级. 2.sps代理增加了--jumper参数,可以穿透外部代理连接上级. +3.修复了--debug不能正常工作的问题. v6.3 1.fixed #156 diff --git a/config.go b/config.go index 01cd782..49532b9 100755 --- a/config.go +++ b/config.go @@ -34,11 +34,12 @@ import ( ) var ( - app *kingpin.Application - service *services.ServiceItem - cmd *exec.Cmd - cpuProfilingFile, memProfilingFile, blockProfilingFile, goroutineProfilingFile, threadcreateProfilingFile *os.File - isDebug bool + app *kingpin.Application + service *services.ServiceItem + cmd *exec.Cmd + cpuProfilingFile, memProfilingFile, blockProfilingFile, + goroutineProfilingFile, threadcreateProfilingFile *os.File + isDebug *bool ) func initConfig() (err error) { @@ -60,7 +61,7 @@ func initConfig() (err error) { //build srvice args app = kingpin.New("proxy", "happy with proxy") app.Author("snail").Version(APP_VERSION) - isDebug := app.Flag("debug", "debug log output").Default("false").Bool() + isDebug = app.Flag("debug", "debug log output").Default("false").Bool() daemon := app.Flag("daemon", "run proxy in background").Default("false").Bool() forever := app.Flag("forever", "run proxy in forever,fail and retry").Default("false").Bool() logfile := app.Flag("log", "log file path").Default("").String() @@ -299,7 +300,7 @@ func initConfig() (err error) { spsArgs.LoadBalanceHashTarget = sps.Flag("lb-hashtarget", "use target address to choose parent for LB").Default("false").Bool() spsArgs.LoadBalanceOnlyHA = sps.Flag("lb-onlyha", "use only `high availability mode` to choose parent for LB").Default("false").Bool() spsArgs.RateLimit = sps.Flag("rate-limit", "rate limit (bytes/second) of each connection, such as: 100K 1.5M . 0 means no limitation").Short('l').Default("0").String() - spsArgs.Jumper = sps.Flag("jumper", "https or socks5 proxies used when connecting to parent, only worked of -T is tls or tcp, format is https://username:password@host:port https://host:port or socks5://username:password@host:port socks5://host:port").Short('J').Default("").String() + spsArgs.Jumper = sps.Flag("jumper", "https or socks5 proxies used when connecting to parent, only worked of -T is tls or tcp, format is https://username:password@host:port https://host:port or socks5://username:password@host:port socks5://host:port").Default("").String() spsArgs.Debug = isDebug //########dns######### diff --git a/main.go b/main.go index 7064501..5e1de1e 100644 --- a/main.go +++ b/main.go @@ -48,7 +48,7 @@ func Clean(s *services.Service) { log.Printf("clean process %d", cmd.Process.Pid) cmd.Process.Kill() } - if isDebug { + if *isDebug { saveProfiling() } cleanupDone <- true