Use recommendation from RFC5966 and set idle timeout much lower

This commit is contained in:
Miek Gieben 2013-10-19 22:00:17 +01:00
parent 2c3eafab12
commit 717a8179f5
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import (
)
const dnsTimeout time.Duration = 2 * 1e9
const tcpIdleTimeout time.Duration = 1 * time.Minute
const tcpIdleTimeout time.Duration = 8 * time.Second
// A Conn represents a connection to a DNS server.
type Conn struct {

View File

@ -195,7 +195,7 @@ type Server struct {
UDPSize int // default buffer size to use to read incoming UDP messages
ReadTimeout time.Duration // the net.Conn.SetReadTimeout value for new connections
WriteTimeout time.Duration // the net.Conn.SetWriteTimeout value for new connections
IdleTimeout func() time.Duration // TCP idle timeout for multilpe queries, if nil, defaults to 1 time.Minute (RFC 5966)
IdleTimeout func() time.Duration // TCP idle timeout for multilpe queries, if nil, defaults to 8 * time.Second (RFC 5966)
TsigSecret map[string]string // secret(s) for Tsig map[<zonename>]<base64 secret>
}