Compile fixes and make it work

This commit is contained in:
Miek Gieben
2016-11-10 12:58:40 +00:00
parent d383f279a0
commit 9328a8e7a4
6 changed files with 9 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ func (a Auto) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
return xfr.ServeDNS(ctx, w, r)
}
answer, ns, extra, result := z.Lookup(qname, state.QType(), state.Do())
answer, ns, extra, result := z.Lookup(state, qname)
m := new(dns.Msg)
m.SetReply(r)

View File

@@ -147,7 +147,7 @@ func autoParse(c *caddy.Controller) (Auto, error) {
case "upstream":
args := c.RemainingArgs()
if len(args) == 0 {
return a, false, c.ArgErr()
return a, c.ArgErr()
}
for i := 0; i < len(args); i++ {
h, p, e := net.SplitHostPort(args[i])

View File

@@ -39,6 +39,7 @@ func TestAutoParse(t *testing.T) {
directory /tmp (.*) bliep
transfer to 127.0.0.1
transfer to 127.0.0.2
upstream 8.8.8.8
}`,
false, "/tmp", "bliep", `(.*)`, []string{"127.0.0.1:53", "127.0.0.2:53"},
},