Its isnt slow

This commit is contained in:
Miek Gieben 2012-01-12 21:32:50 +01:00
parent 7ddb5feb69
commit 7f6a5f4497
2 changed files with 10 additions and 9 deletions

View File

@ -91,6 +91,11 @@ func TestClientTsigAXFR(t *testing.T) {
if ex.Error == ErrXfrLast {
break
}
if ex.Error != nil {
t.Logf("Error %s\n", ex.Error.Error())
t.Fail()
break
}
if ex.Reply.Rcode != RcodeSuccess {
break
}
@ -115,6 +120,11 @@ func TestClientAXFRMultipleMessages(t *testing.T) {
if ex.Error == ErrXfrLast {
break
}
if ex.Error != nil {
t.Logf("Error %s\n", ex.Error.Error())
t.Fail()
break
}
if ex.Reply.Rcode != RcodeSuccess {
break
}

9
msg.go
View File

@ -892,17 +892,8 @@ func unpackRR(msg []byte, off int) (rr RR, off1 int, ok bool) {
if off, ok = unpackStruct(&h, msg, off); !ok {
return nil, len(msg), false
}
rrtype, rdlength, off4 := RawTypeRdlength(msg, off0)
if rrtype == 0 {
return nil, len(msg), false
}
end := off + int(h.Rdlength)
println(h.Rdlength, "me l", rdlength)
println(h.Rrtype, "me t", rrtype)
println(end, "me tl", off4+int(rdlength))
// make an rr of that type and re-unpack.
// again inefficient but doesn't need to be fast. TODO speed
mk, known := rr_mk[h.Rrtype]
if !known {
rr = new(RR_RFC3597)