aboutsummaryrefslogtreecommitdiff
path: root/plugin/forward/proxy.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-09-19 07:29:37 +0100
committerGravatar GitHub <noreply@github.com> 2018-09-19 07:29:37 +0100
commitc349446a23440b336f4ca21900cce4d6a031cdf5 (patch)
tree983ab79eac59d59e36dfbf4a29fcf1bd811110d5 /plugin/forward/proxy.go
parent2f1223c36a0294cd07e299aaa792a0b3f51f687a (diff)
downloadcoredns-c349446a23440b336f4ca21900cce4d6a031cdf5.tar.gz
coredns-c349446a23440b336f4ca21900cce4d6a031cdf5.tar.zst
coredns-c349446a23440b336f4ca21900cce4d6a031cdf5.zip
Cleanup ParseHostOrFile (#2100)
Create plugin/pkg/transport that holds the transport related functions. This needed to be a new pkg to prevent cyclic import errors. This cleans up a bunch of duplicated code in core/dnsserver that also tried to parse a transport (now all done in transport.Parse). Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/forward/proxy.go')
-rw-r--r--plugin/forward/proxy.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/forward/proxy.go b/plugin/forward/proxy.go
index ac74bf0f8..453dd015b 100644
--- a/plugin/forward/proxy.go
+++ b/plugin/forward/proxy.go
@@ -18,7 +18,7 @@ type Proxy struct {
// Connection caching
expire time.Duration
- transport *transport
+ transport *Transport
// health checking
probe *up.Probe
@@ -26,7 +26,7 @@ type Proxy struct {
}
// NewProxy returns a new proxy.
-func NewProxy(addr string, protocol int) *Proxy {
+func NewProxy(addr, trans string) *Proxy {
p := &Proxy{
addr: addr,
fails: 0,
@@ -34,7 +34,7 @@ func NewProxy(addr string, protocol int) *Proxy {
transport: newTransport(addr),
avgRtt: int64(maxTimeout / 2),
}
- p.health = NewHealthChecker(protocol)
+ p.health = NewHealthChecker(trans)
runtime.SetFinalizer(p, (*Proxy).finalizer)
return p
}