Update to the new apip

This commit is contained in:
Miek Gieben 2012-05-05 17:41:40 +02:00
parent d8c47bafbd
commit 2ae73f6fc6
5 changed files with 7 additions and 7 deletions

View File

@ -10,7 +10,7 @@ func TestClientSync(t *testing.T) {
m.SetQuestion("miek.nl.", TypeSOA)
c := NewClient()
r, _ := c.Exchange(m, "85.223.71.124:53")
r, _ , _, _:= c.Exchange(m, "85.223.71.124:53")
if r != nil && r.Rcode != RcodeSuccess {
t.Log("Failed to get an valid answer")
@ -58,7 +58,7 @@ func TestClientEDNS0(t *testing.T) {
//edns.SetNsid("") // Empty to request it
c := NewClient()
r, _ := c.Exchange(m, "85.223.71.124:53")
r, _, _, _ := c.Exchange(m, "85.223.71.124:53")
if r != nil && r.Rcode != RcodeSuccess {
t.Log("Failed to get an valid answer")

View File

@ -7,7 +7,7 @@ import (
func sendit(u *Msg) (r *Msg, e error) {
c := NewClient()
r, e = c.Exchange(u, "127.0.0.1:53")
r, _, _, e = c.Exchange(u, "127.0.0.1:53")
return r, e
}

View File

@ -27,12 +27,12 @@ func main() {
}
for _, a := range addr {
m.Question[0] = dns.Question{"version.bind.", dns.TypeTXT, dns.ClassCHAOS}
in, rtt, _ := c.Exchange(m, a)
in, rtt, _, _ := c.Exchange(m, a)
if in != nil && len(in.Answer) > 0 {
fmt.Printf("(time %.3d µs) %v\n", rtt/1e3, in.Answer[0])
}
m.Question[0] = dns.Question{"hostname.bind.", dns.TypeTXT, dns.ClassCHAOS}
in, rtt, _ = c.Exchange(m, a)
in, rtt, _, _ = c.Exchange(m, a)
if in != nil && len(in.Answer) > 0 {
fmt.Printf("(time %.3d µs) %v\n", rtt/1e3, in.Answer[0])
}

View File

@ -13,7 +13,7 @@ import (
// returns a fingerprint.
func probe(c *dns.Client, addr string, f *fingerprint) *fingerprint {
m := f.msg()
r, _, err := c.Exchange(m, addr)
r, _, _, err := c.Exchange(m, addr)
if err != nil {
return errorToFingerprint(err)
}

View File

@ -21,7 +21,7 @@ func main() {
m.SetEdns0(2048, true)
c := dns.NewClient()
r, _, _ := c.Exchange(m, conf.Servers[0] + ":" + conf.Port)
r, _, _, _ := c.Exchange(m, conf.Servers[0] + ":" + conf.Port)
if r == nil {
fmt.Printf("*** no answer received for %s\n", os.Args[1])
os.Exit(1)