Also use Dial in xfr

This commit is contained in:
Miek Gieben 2013-11-01 09:44:24 +00:00
parent 37c7c70289
commit 7087f6a88c
1 changed files with 1 additions and 3 deletions

4
xfr.go
View File

@ -7,7 +7,6 @@
package dns package dns
import ( import (
"net"
"time" "time"
) )
@ -29,12 +28,11 @@ type Transfer struct {
// In performs an incoming transfer with the server in a. // In performs an incoming transfer with the server in a.
func (t *Transfer) In(q *Msg, a string) (env chan *Envelope, err error) { func (t *Transfer) In(q *Msg, a string) (env chan *Envelope, err error) {
t.Conn = new(Conn)
timeout := dnsTimeout timeout := dnsTimeout
if t.DialTimeout != 0 { if t.DialTimeout != 0 {
timeout = t.DialTimeout timeout = t.DialTimeout
} }
t.Conn.Conn, err = net.DialTimeout("tcp", a, timeout) t.Conn, err = DialTimeout("tcp", a, timeout)
if err != nil { if err != nil {
return nil, err return nil, err
} }