axfr outgoing is working, but only for one envelop

This commit is contained in:
Miek Gieben 2012-08-28 20:29:06 +02:00
parent c07f45ab5d
commit 1b2b39f300
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ func handleReflect(w dns.ResponseWriter, r *dns.Msg) {
c <- &dns.XfrToken{RR: []dns.RR{soa, t, rr, soa}}
close(c)
w.Hijack()
w.Close()
// w.Close() // Client closes
return
case dns.TypeTXT:
m.Answer = append(m.Answer, t)

4
xfr.go
View File

@ -156,7 +156,7 @@ func checkXfrSOA(in *Msg, first bool) bool {
// c := make(chan *XfrToken)
// var e *error
// err := XfrSend(w, q, c, e)
// w.Hijack()
// w.Hijack() // hijack the connection so that the library doesn't close it
// for _, rrset := range rrsets { // rrset is a []RR
// c <- &{XfrToken{RR: rrset}
// if e != nil {
@ -164,7 +164,7 @@ func checkXfrSOA(in *Msg, first bool) bool {
// break
// }
// }
// w.Close()
// // w.Close() // Don't! Let the client close the connection
func XfrSend(w ResponseWriter, q *Msg, c chan *XfrToken, e *error) error {
switch q.Question[0].Qtype {
case TypeAXFR, TypeIXFR: