Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidquan111 committed Jun 26, 2020
1 parent f779bb8 commit 6ff04e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
tcpKeepAlive tcp生存时间, 默认: 60s
enableHttpDNS httpDNS开关, #t则开,#f则关
enableTFO tcpFastOpen开关, #t则开,#f则关
enableDaemon 开启后台运行, #t则开,#f则关
可选参数:
password 加密密码, 没有则不加密
pidPath pid文件路径, 没有则不保存

##### 命令行选项

-h, --help 显示帮助
-config-file 指定新的`config.cfg`的文件路径
-daemon 开启后台运行, 默认开启
-h, --help 显示帮助

##### 编译

Expand Down
7 changes: 1 addition & 6 deletions cns.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func handleCmd() {
// flag.BoolVar(&enable_dns_tcpOverUdp, "dns-tcpOverUdp", true, "tcpDNS Over udpDNS switch")
// flag.BoolVar(&enable_httpDNS, "enable-httpDNS", true, "httpDNS server switch")
// flag.BoolVar(&enable_TFO, "enable-TFO", true, "listener tcpFastOpen switch")
// flag.BoolVar(&enable_daemon, "daemon", true, "daemon mode switch")
flag.BoolVar(&enable_daemon, "daemon", true, "daemon mode switch(开启后台运行)")
flag.StringVar(&configFile, "config-file", "config.cfg", "set configuration file, default `config.cfg`(指定配置文件,不指定时默认为`config.cfg`)")
flag.BoolVar(&isHelp, "help", false, "display this message(显示此帮助信息)")

Expand Down Expand Up @@ -139,11 +139,6 @@ func handleCmd() {
} else {
enable_TFO = false
}
if configMap["enableDaemon"] == "#t" {
enable_daemon = true
} else {
enable_daemon = false
}

flag.Parse()
if isHelp {
Expand Down
3 changes: 1 addition & 2 deletions config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ tcpKeepAlive = 60
pidPath = cns.pid
enableDnsTcpOverUdp = #t
enableHttpDNS = #t
enableTFO = #t
enableDaemon = #t
enableTFO = #t

0 comments on commit 6ff04e3

Please sign in to comment.