diff options
Diffstat (limited to 'middleware/file/xfr.go')
-rw-r--r-- | middleware/file/xfr.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/middleware/file/xfr.go b/middleware/file/xfr.go index ed1862451..92811d7a7 100644 --- a/middleware/file/xfr.go +++ b/middleware/file/xfr.go @@ -2,6 +2,7 @@ package file import ( "fmt" + "log" "github.com/miekg/coredns/middleware" @@ -24,9 +25,6 @@ func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (in if state.QType() != dns.TypeAXFR { return 0, fmt.Errorf("xfr called with non transfer type: %d", state.QType()) } - if state.Proto() == "udp" { - return 0, fmt.Errorf("xfr called with udp") - } records := x.All() if len(records) == 0 { @@ -40,6 +38,7 @@ func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (in j, l := 0, 0 records = append(records, records[0]) // add closing SOA to the end + log.Printf("[INFO] Outgoing transfer of %d records of zone %s to %s started", len(records), x.name, state.IP()) for i, r := range records { l += dns.Len(r) if l > transferLength { @@ -57,4 +56,4 @@ func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (in return dns.RcodeSuccess, nil } -const transferLength = 100 // Start a new envelop after message reaches this size. Intentionally small to test multi envelope parsing +const transferLength = 1000 // Start a new envelop after message reaches this size in bytes. Intentionally small to test multi envelope parsing. |