aboutsummaryrefslogtreecommitdiff
path: root/plugin/proxy/upstream.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/proxy/upstream.go')
-rw-r--r--plugin/proxy/upstream.go30
1 files changed, 1 insertions, 29 deletions
diff --git a/plugin/proxy/upstream.go b/plugin/proxy/upstream.go
index b60b6ff58..f7ad58ea8 100644
--- a/plugin/proxy/upstream.go
+++ b/plugin/proxy/upstream.go
@@ -4,7 +4,6 @@ import (
"fmt"
"net"
"strconv"
- "sync/atomic"
"time"
"github.com/coredns/coredns/plugin"
@@ -20,7 +19,6 @@ type staticUpstream struct {
healthcheck.HealthCheck
- WithoutPathPrefix string
IgnoredSubDomains []string
ex Exchanger
}
@@ -69,28 +67,7 @@ func NewStaticUpstreams(c *caddyfile.Dispenser) ([]Upstream, error) {
Conns: 0,
Fails: 0,
FailTimeout: upstream.FailTimeout,
-
- CheckDown: func(upstream *staticUpstream) healthcheck.UpstreamHostDownFunc {
- return func(uh *healthcheck.UpstreamHost) bool {
-
- down := false
-
- uh.CheckMu.Lock()
- until := uh.OkUntil
- uh.CheckMu.Unlock()
-
- if !until.IsZero() && time.Now().After(until) {
- down = true
- }
-
- fails := atomic.LoadInt32(&uh.Fails)
- if fails >= upstream.MaxFails && upstream.MaxFails != 0 {
- down = true
- }
- return down
- }
- }(upstream),
- WithoutPathPrefix: upstream.WithoutPathPrefix,
+ CheckDown: checkDownFunc(upstream),
}
upstream.Hosts[i] = uh
@@ -158,11 +135,6 @@ func parseBlock(c *caddyfile.Dispenser, u *staticUpstream) error {
u.Future = 3 * time.Second
}
}
- case "without":
- if !c.NextArg() {
- return c.ArgErr()
- }
- u.WithoutPathPrefix = c.Val()
case "except":
ignoredDomains := c.RemainingArgs()
if len(ignoredDomains) == 0 {