Pull request: 2704 local addresses vol.4
Updates #2704. Squashed commit of the following: commit bbc292a1c9dc7382e1116cfd85fea22ab8de6949 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Apr 9 19:22:46 2021 +0300 all: replace exchanger with proxy
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package dnsforward
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -403,21 +402,18 @@ func (s *Server) processLocalPTR(ctx *dnsContext) (rc resultCode) {
|
||||
return resultCodeSuccess
|
||||
}
|
||||
|
||||
req := d.Req
|
||||
resp, err := s.localResolvers.Exchange(req)
|
||||
err := s.localResolvers.Resolve(d)
|
||||
if err != nil {
|
||||
if errors.Is(err, aghnet.NoUpstreamsErr) {
|
||||
d.Res = s.genNXDomain(req)
|
||||
|
||||
return resultCodeFinish
|
||||
}
|
||||
|
||||
ctx.err = err
|
||||
|
||||
return resultCodeError
|
||||
}
|
||||
|
||||
d.Res = resp
|
||||
if d.Res == nil {
|
||||
d.Res = s.genNXDomain(d.Req)
|
||||
|
||||
return resultCodeFinish
|
||||
}
|
||||
|
||||
return resultCodeSuccess
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user