udp msg size

This commit is contained in:
Miek Gieben 2012-01-29 00:21:12 +01:00
parent f1542e15d9
commit 3ebacbaac8
2 changed files with 2 additions and 2 deletions

2
dns.go
View File

@ -69,7 +69,7 @@ import (
const (
Year68 = 1 << 32 // For RFC1982 (Serial Arithmetic) calculations in 32 bits.
DefaultMsgSize = 4096 // Standard default for larger than 512 packets.
UDPReceiveMsgSize = 360 // Default buffer size for servers receiving UDP packets.
UDPMsgSize = 512 // Default buffer size for servers receiving UDP packets.
MaxMsgSize = 65536 // Largest possible DNS packet.
DefaultTtl = 3600 // Default TTL.
)

View File

@ -236,7 +236,7 @@ func (srv *Server) ServeUDP(l *net.UDPConn) error {
handler = DefaultServeMux
}
if srv.UDPSize == 0 {
srv.UDPSize = UDPReceiveMsgSize
srv.UDPSize = UDPMsgSize
}
for {
m := make([]byte, srv.UDPSize)