From fe160dfba46c520702b467d10990dd85d546d29c Mon Sep 17 00:00:00 2001 From: StalkR Date: Thu, 15 Jan 2015 23:11:11 +0100 Subject: [PATCH] minor clean ups: use time.Second instead of 1e9, do not reference ns as time.Duration is enough --- client.go | 8 ++++---- xfr.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client.go b/client.go index ee8e2233..76767522 100644 --- a/client.go +++ b/client.go @@ -9,7 +9,7 @@ import ( "time" ) -const dnsTimeout time.Duration = 2 * 1e9 +const dnsTimeout time.Duration = 2 * time.Second const tcpIdleTimeout time.Duration = 8 * time.Second // A Conn represents a connection to a DNS server. @@ -26,9 +26,9 @@ type Conn struct { type Client struct { Net string // if "tcp" a TCP query will be initiated, otherwise an UDP one (default is "" for UDP) UDPSize uint16 // minimum receive buffer for UDP messages - DialTimeout time.Duration // net.DialTimeout (ns), defaults to 2 * 1e9 - ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections (ns), defaults to 2 * 1e9 - WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections (ns), defaults to 2 * 1e9 + DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds + ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds + WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds TsigSecret map[string]string // secret(s) for Tsig map[], zonename must be fully qualified SingleInflight bool // if true suppress multiple outstanding queries for the same Qname, Qtype and Qclass group singleflight diff --git a/xfr.go b/xfr.go index d220aa1d..e9a500a7 100644 --- a/xfr.go +++ b/xfr.go @@ -13,9 +13,9 @@ type Envelope struct { // A Transfer defines parameters that are used during a zone transfer. type Transfer struct { *Conn - DialTimeout time.Duration // net.DialTimeout (ns), defaults to 2 * 1e9 - ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections (ns), defaults to 2 * 1e9 - WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections (ns), defaults to 2 * 1e9 + DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds + ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds + WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds TsigSecret map[string]string // Secret(s) for Tsig map[], zonename must be fully qualified tsigTimersOnly bool }