Make q print number of envelopes when doing axfr

This commit is contained in:
Miek Gieben 2013-10-12 13:27:03 +01:00
parent 7691523300
commit d0818e2321
2 changed files with 5 additions and 1 deletions

View File

@ -222,6 +222,8 @@ Flags:
fmt.Printf(";; %s\n", err.Error()) fmt.Printf(";; %s\n", err.Error())
continue continue
} }
envelope := 0
record := 0
for e := range env { for e := range env {
if e.Error != nil { if e.Error != nil {
fmt.Printf(";; %s\n", e.Error.Error()) fmt.Printf(";; %s\n", e.Error.Error())
@ -230,7 +232,10 @@ Flags:
for _, r := range e.RR { for _, r := range e.RR {
fmt.Printf("%s\n", r) fmt.Printf("%s\n", r)
} }
record+=len(e.RR)
envelope++
} }
fmt.Printf("\n;; xfr size: %d records (envelopes %d)\n", record, envelope)
continue continue
} }
r, rtt, e := c.Exchange(m, nameserver) r, rtt, e := c.Exchange(m, nameserver)

1
xfr.go
View File

@ -132,7 +132,6 @@ func (t *Transfer) inIxfr(id uint16, c chan *Envelope) {
// This serial is important // This serial is important
serial = in.Answer[0].(*SOA).Serial serial = in.Answer[0].(*SOA).Serial
first = !first first = !first
// continue // TODO(miek): ?
} }
// Now we need to check each message for SOA records, to see what we need to do // Now we need to check each message for SOA records, to see what we need to do