Fixing review comments

This commit is contained in:
Andrey Meshkov
2018-12-24 18:47:33 +03:00
parent 2bc1d737cc
commit 374a0dc2e5
4 changed files with 29 additions and 25 deletions

View File

@@ -125,7 +125,7 @@ func (s *Server) startInternal(config *ServerConfig) error {
RefuseAny: s.RefuseAny,
CacheEnabled: true,
Upstreams: s.Upstreams,
Handler: s,
Handler: s.handleDNSRequest,
}
if proxyConfig.UDPListenAddr == nil {
@@ -220,8 +220,8 @@ func (s *Server) Reconfigure(config *ServerConfig) error {
return nil
}
// ServeDNS filters the incoming DNS requests and writes them to the query log
func (s *Server) ServeDNS(d *proxy.DNSContext, next proxy.Handler) error {
// handleDNSRequest filters the incoming DNS requests and writes them to the query log
func (s *Server) handleDNSRequest(p *proxy.Proxy, d *proxy.DNSContext) error {
start := time.Now()
// use dnsfilter before cache -- changed settings or filters would require cache invalidation otherwise
@@ -232,7 +232,7 @@ func (s *Server) ServeDNS(d *proxy.DNSContext, next proxy.Handler) error {
if d.Res == nil {
// request was not filtered so let it be processed further
err = next.ServeDNS(d, nil)
err = p.Resolve(d)
if err != nil {
return err
}