Keep the default LB strategy if an invalid p* one is used

This commit is contained in:
Frank Denis 2020-03-20 20:53:03 +01:00
parent 62a20fd97a
commit d876c7b487
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,7 @@ require_dnssec = true
dnscrypt_ephemeral_keys = true
tls_disable_session_tickets = false
ignore_system_dns = false
lb_strategy = 'p12'
block_ipv6 = true
block_unqualified = true
block_undelegated = true

View File

@ -375,9 +375,10 @@ func ConfigLoad(proxy *Proxy, flags *ConfigFlags) error {
if strings.HasPrefix(lbStrategyStr, "p") {
n, err := strconv.ParseInt(strings.TrimPrefix(lbStrategyStr, "p"), 10, 32)
if err != nil || n <= 0 {
dlog.Fatalf("Invalid load balancing strategy: [%s]", config.LBStrategy)
dlog.Warnf("Invalid load balancing strategy: [%s]", config.LBStrategy)
} else {
lbStrategy = LBStrategyPN{n: int(n)}
}
lbStrategy = LBStrategyPN{n: int(n)}
} else {
dlog.Warnf("Unknown load balancing strategy: [%s]", config.LBStrategy)
}