From 225cdd1ca387b409c07269db44100643fccb620c Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 6 Apr 2016 22:29:33 +0100 Subject: Add AXFR test Test shouldTransfer by upping a testserver and sending the SOA query. Remove state from DefaultErrorHandler and just get it from the request. Add more logging to show what is going on. This also adds the infrastructure for future tests. --- middleware/file/file.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'middleware/file/file.go') diff --git a/middleware/file/file.go b/middleware/file/file.go index 7ec690f3c..fcb1ce6e2 100644 --- a/middleware/file/file.go +++ b/middleware/file/file.go @@ -47,11 +47,16 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i m.Authoritative, m.RecursionAvailable, m.Compress = true, true, true w.WriteMsg(m) - if ok, _ := z.shouldTransfer(); ok { - log.Printf("[INFO] Valid notify from %s for %s: initiating transfer", state.IP(), zone) + log.Printf("[INFO] Notify from %s for %s: checking transfer", state.IP(), zone) + ok, err := z.shouldTransfer() + if ok { z.TransferIn() + } else { + log.Printf("[INFO] Notify from %s for %s: no serial increase seen", state.IP(), zone) + } + if err != nil { + log.Printf("[WARNING] Notify from %s for %s: failed primary check: %s", state.IP(), zone, err) } - return dns.RcodeSuccess, nil } log.Printf("[INFO] Dropping notify from %s for %s", state.IP(), zone) -- cgit v1.2.3