mirror of
https://github.com/miekg/dns.git
synced 2025-10-17 12:51:00 +02:00
debugging
This commit is contained in:
parent
b1f63f57c4
commit
ab035e636f
2
dns.go
2
dns.go
@ -207,7 +207,9 @@ func (d *Conn) Exchange(request []byte, nosend bool) (reply []byte, err os.Error
|
||||
reply = make([]byte, DefaultMsgSize)
|
||||
}
|
||||
n, err = d.Read(reply)
|
||||
println("READ ", n)
|
||||
if err != nil {
|
||||
println(err.String())
|
||||
return nil, err
|
||||
}
|
||||
reply = reply[:n]
|
||||
|
5
msg.go
5
msg.go
@ -16,7 +16,7 @@ package dns
|
||||
|
||||
import (
|
||||
"os"
|
||||
"fmt"
|
||||
// "fmt"
|
||||
"reflect"
|
||||
"net"
|
||||
"rand"
|
||||
@ -210,7 +210,6 @@ func unpackDomainName(msg []byte, off int) (s string, off1 int, ok bool) {
|
||||
Loop:
|
||||
for {
|
||||
if off >= len(msg) {
|
||||
println(off, len(msg))
|
||||
return "", len(msg), false
|
||||
}
|
||||
c := int(msg[off])
|
||||
@ -658,7 +657,7 @@ func unpackStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int,
|
||||
case "domain-name":
|
||||
s, off, ok = unpackDomainName(msg, off)
|
||||
if !ok {
|
||||
fmt.Fprintf(os.Stderr, "dns: failure unpacking domain-name")
|
||||
//fmt.Fprintf(os.Stderr, "dns: failure unpacking domain-name")
|
||||
return len(msg), false
|
||||
}
|
||||
case "size-base32":
|
||||
|
Loading…
x
Reference in New Issue
Block a user