dnsforward: imp code
This commit is contained in:
parent
90919f99a9
commit
069ee22c6d
|
@ -232,13 +232,7 @@ func (req *jsonDNSConfig) checkUpstreamMode() (err error) {
|
|||
}
|
||||
|
||||
switch um := *req.UpstreamMode; um {
|
||||
case "":
|
||||
return nil
|
||||
case "parallel":
|
||||
return nil
|
||||
case "fastest_addr":
|
||||
return nil
|
||||
case "load_balance":
|
||||
case "", "parallel", "fastest_addr", "load_balance":
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("upstream_mode: incorrect value %q", um)
|
||||
|
@ -474,9 +468,7 @@ func (s *Server) setConfig(dc *jsonDNSConfig) (shouldRestart bool) {
|
|||
// case of invalid value.
|
||||
func mustParseUpstreamMode(mode string) (um string) {
|
||||
switch mode {
|
||||
case "":
|
||||
return UpstreamModeTypeLoadBalance
|
||||
case "load_balance":
|
||||
case "", "load_balance":
|
||||
return UpstreamModeTypeLoadBalance
|
||||
case "parallel":
|
||||
return UpstreamModeTypeParallel
|
||||
|
|
Loading…
Reference in New Issue