some more fixes

This commit is contained in:
Miek Gieben 2011-03-30 19:17:14 +02:00
parent 9582fd005a
commit beb14241fc
3 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ func handleXfrOut(d *dns.Conn, i *dns.Msg) os.Error {
fmt.Printf("Matchies current zone\n") fmt.Printf("Matchies current zone\n")
if !Zone.correct { if !Zone.correct {
fmt.Printf("Zone was not deemed correct\n") fmt.Printf("Zone was not deemed correct\n")
d.WriteMsg(i)
return nil return nil
} else { } else {
fmt.Printf("Zone was correct\n") fmt.Printf("Zone was correct\n")
@ -31,6 +32,7 @@ func handleXfrOut(d *dns.Conn, i *dns.Msg) os.Error {
close(m) close(m)
} else { } else {
fmt.Printf("No matching zone found\n") fmt.Printf("No matching zone found\n")
d.WriteMsg(i)
} }
} }
return nil return nil

View File

@ -37,7 +37,7 @@ func handle(d *dns.Conn, i *dns.Msg) {
handleXfrOut(d, i) handleXfrOut(d, i)
if Zone.name != "" { if Zone.name != "" {
// We have transfered a zone and can check it. For now assume ok. // We have transfered a zone and can check it. For now assume ok.
Zone.correct = true Zone.correct = false
} }
} }

1
xfr.go
View File

@ -149,7 +149,6 @@ func (d *Conn) axfrWrite(q *Msg, m chan *Xfr, e chan os.Error) {
// Everything is sent, only the closing soa is left. // Everything is sent, only the closing soa is left.
out.Answer[i] = soa out.Answer[i] = soa
out.Answer = out.Answer[:i+1] out.Answer = out.Answer[:i+1]
println("Sending", out.String())
err := d.WriteMsg(out) err := d.WriteMsg(out)
if err != nil { if err != nil {
e <- err e <- err