aboutsummaryrefslogtreecommitdiff
path: root/middleware/file/xfr.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-04-05 15:54:06 +0100
committerGravatar Miek Gieben <miek@miek.nl> 2016-04-05 15:54:06 +0100
commit8892a1b49042e4e9f9ca011fecee31bc367b0e53 (patch)
treeab7d15fc0335b0a2b7d1e1ac3372af3a969037ed /middleware/file/xfr.go
parentc961acbb6e9e06279d3dca077ba47d8a6170da20 (diff)
downloadcoredns-8892a1b49042e4e9f9ca011fecee31bc367b0e53.tar.gz
coredns-8892a1b49042e4e9f9ca011fecee31bc367b0e53.tar.zst
coredns-8892a1b49042e4e9f9ca011fecee31bc367b0e53.zip
Middleware chaining fixes
For prometheus use the plain value, not a pointer and change all usages. Allow AXFR to be requested over udp as well and some other more log printed when commencing an AXFR.
Diffstat (limited to 'middleware/file/xfr.go')
-rw-r--r--middleware/file/xfr.go7
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.