File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ const defaultReadTimeout = 2 * time.Second
1818// then we start using defaultTCPIdleTimeout
1919const defaultTCPIdleTimeout = 8 * time .Second
2020
21+ // defaultUDPSize is the size of the UDP read buffer. Using 1252 by default,
22+ // see here: https://github.com/AdguardTeam/AdGuardDNS/issues/188
23+ const defaultUDPSize = 1252
24+
2125// helper struct that is used in several SetReadDeadline calls
2226var longTimeAgo = time .Unix (1 , 0 )
2327
@@ -49,7 +53,7 @@ type Server struct {
4953 ResolverCert * Cert
5054
5155 // UDPSize is the default buffer size to use to read incoming UDP messages.
52- // If not set it defaults to dns.MinMsgSize (512 B).
56+ // If not set it defaults to defaultUDPSize (1252 B).
5357 UDPSize int
5458
5559 // Handler to invoke. If nil, uses DefaultHandler.
@@ -154,7 +158,7 @@ func (s *Server) init() {
154158 s .tcpListeners = map [net.Listener ]struct {}{}
155159
156160 if s .UDPSize == 0 {
157- s .UDPSize = dns . MinMsgSize
161+ s .UDPSize = defaultUDPSize
158162 }
159163}
160164
You can’t perform that action at this time.
0 commit comments