client: add login_fail_exit params, default is true

if login_fail_exit is false, when frpc first login to server failed, it
    will continues relogin to server every 30 seconds.
This commit is contained in:
fatedier
2017-05-25 01:10:58 +08:00
parent 6c13b6d37a
commit 4dc96f41c9
9 changed files with 174 additions and 156 deletions

View File

@ -38,6 +38,7 @@ type ClientCommonConf struct {
PoolCount int
TcpMux bool
User string
LoginFailExit bool
HeartBeatInterval int64
HeartBeatTimeout int64
}
@ -56,6 +57,7 @@ func GetDeaultClientCommonConf() *ClientCommonConf {
PoolCount: 1,
TcpMux: true,
User: "",
LoginFailExit: true,
HeartBeatInterval: 30,
HeartBeatTimeout: 90,
}
@ -134,6 +136,13 @@ func LoadClientCommonConf(conf ini.File) (cfg *ClientCommonConf, err error) {
cfg.User = tmpStr
}
tmpStr, ok = conf.Get("common", "login_fail_exit")
if ok && tmpStr == "false" {
cfg.LoginFailExit = false
} else {
cfg.LoginFailExit = true
}
tmpStr, ok = conf.Get("common", "heartbeat_timeout")
if ok {
v, err = strconv.ParseInt(tmpStr, 10, 64)