mirror of
https://github.com/miekg/dns.git
synced 2025-10-18 05:11:01 +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)
|
reply = make([]byte, DefaultMsgSize)
|
||||||
}
|
}
|
||||||
n, err = d.Read(reply)
|
n, err = d.Read(reply)
|
||||||
|
println("READ ", n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
println(err.String())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
reply = reply[:n]
|
reply = reply[:n]
|
||||||
|
5
msg.go
5
msg.go
@ -16,7 +16,7 @@ package dns
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"fmt"
|
// "fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"net"
|
"net"
|
||||||
"rand"
|
"rand"
|
||||||
@ -210,7 +210,6 @@ func unpackDomainName(msg []byte, off int) (s string, off1 int, ok bool) {
|
|||||||
Loop:
|
Loop:
|
||||||
for {
|
for {
|
||||||
if off >= len(msg) {
|
if off >= len(msg) {
|
||||||
println(off, len(msg))
|
|
||||||
return "", len(msg), false
|
return "", len(msg), false
|
||||||
}
|
}
|
||||||
c := int(msg[off])
|
c := int(msg[off])
|
||||||
@ -658,7 +657,7 @@ func unpackStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int,
|
|||||||
case "domain-name":
|
case "domain-name":
|
||||||
s, off, ok = unpackDomainName(msg, off)
|
s, off, ok = unpackDomainName(msg, off)
|
||||||
if !ok {
|
if !ok {
|
||||||
fmt.Fprintf(os.Stderr, "dns: failure unpacking domain-name")
|
//fmt.Fprintf(os.Stderr, "dns: failure unpacking domain-name")
|
||||||
return len(msg), false
|
return len(msg), false
|
||||||
}
|
}
|
||||||
case "size-base32":
|
case "size-base32":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user