From 2e89c8da0131abc771bd0cbf50fe210ff1878567 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 2 Jun 2019 13:24:24 +0200 Subject: [PATCH] Rename LbStrategyFastest to LbStrategyFirst --- dnscrypt-proxy/config.go | 3 ++- dnscrypt-proxy/example-dnscrypt-proxy.toml | 2 +- dnscrypt-proxy/serversInfo.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dnscrypt-proxy/config.go b/dnscrypt-proxy/config.go index 7b31fd13..a67fffc4 100644 --- a/dnscrypt-proxy/config.go +++ b/dnscrypt-proxy/config.go @@ -309,7 +309,8 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error { case "ph": lbStrategy = LBStrategyPH case "fastest": - lbStrategy = LBStrategyFastest + case "first": + lbStrategy = LBStrategyFirst case "random": lbStrategy = LBStrategyRandom default: diff --git a/dnscrypt-proxy/example-dnscrypt-proxy.toml b/dnscrypt-proxy/example-dnscrypt-proxy.toml index 2f9b72dd..752b5588 100644 --- a/dnscrypt-proxy/example-dnscrypt-proxy.toml +++ b/dnscrypt-proxy/example-dnscrypt-proxy.toml @@ -118,7 +118,7 @@ keepalive = 30 refused_code_in_responses = false -## Load-balancing strategy: 'p2' (default), 'ph', 'fastest' or 'random' +## Load-balancing strategy: 'p2' (default), 'ph', 'first' or 'random' # lb_strategy = 'p2' diff --git a/dnscrypt-proxy/serversInfo.go b/dnscrypt-proxy/serversInfo.go index 798acfea..4fbcaeb2 100644 --- a/dnscrypt-proxy/serversInfo.go +++ b/dnscrypt-proxy/serversInfo.go @@ -56,7 +56,7 @@ const ( LBStrategyNone = LBStrategy(iota) LBStrategyP2 LBStrategyPH - LBStrategyFastest + LBStrategyFirst LBStrategyRandom ) @@ -192,7 +192,7 @@ func (serversInfo *ServersInfo) getOne() *ServerInfo { } } switch serversInfo.lbStrategy { - case LBStrategyFastest: + case LBStrategyFirst: candidate = 0 case LBStrategyPH: candidate = rand.Intn(Min(Min(serversCount, 2), serversCount/2))