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 {
|
switch um := *req.UpstreamMode; um {
|
||||||
case "":
|
case "", "parallel", "fastest_addr", "load_balance":
|
||||||
return nil
|
|
||||||
case "parallel":
|
|
||||||
return nil
|
|
||||||
case "fastest_addr":
|
|
||||||
return nil
|
|
||||||
case "load_balance":
|
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("upstream_mode: incorrect value %q", um)
|
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.
|
// case of invalid value.
|
||||||
func mustParseUpstreamMode(mode string) (um string) {
|
func mustParseUpstreamMode(mode string) (um string) {
|
||||||
switch mode {
|
switch mode {
|
||||||
case "":
|
case "", "load_balance":
|
||||||
return UpstreamModeTypeLoadBalance
|
|
||||||
case "load_balance":
|
|
||||||
return UpstreamModeTypeLoadBalance
|
return UpstreamModeTypeLoadBalance
|
||||||
case "parallel":
|
case "parallel":
|
||||||
return UpstreamModeTypeParallel
|
return UpstreamModeTypeParallel
|
||||||
|
|
Loading…
Reference in New Issue