1
0
mirror of https://github.com/DNSCrypt/dnscrypt-proxy.git synced 2025-01-01 00:57:32 +01:00

cleanup: proxy: use symbolic code for SERVFAIL

This commit is contained in:
Markus Linnala 2019-10-03 20:25:20 +03:00 committed by Frank Denis
parent e8ad2be9f9
commit 80fa99877f

View File

@ -13,6 +13,7 @@ import (
"github.com/jedisct1/dlog" "github.com/jedisct1/dlog"
clocksmith "github.com/jedisct1/go-clocksmith" clocksmith "github.com/jedisct1/go-clocksmith"
stamps "github.com/jedisct1/go-dnsstamps" stamps "github.com/jedisct1/go-dnsstamps"
"github.com/miekg/dns"
"golang.org/x/crypto/curve25519" "golang.org/x/crypto/curve25519"
) )
@ -453,7 +454,7 @@ func (proxy *Proxy) processIncomingQuery(serverInfo *ServerInfo, clientProto str
serverInfo.noticeFailure(proxy) serverInfo.noticeFailure(proxy)
return return
} }
if rcode := Rcode(response); rcode == 2 { // SERVFAIL if rcode := Rcode(response); rcode == dns.RcodeServerFailure {
dlog.Infof("Server [%v] returned temporary error code [%v] -- Upstream server may be experiencing connectivity issues", serverInfo.Name, rcode) dlog.Infof("Server [%v] returned temporary error code [%v] -- Upstream server may be experiencing connectivity issues", serverInfo.Name, rcode)
serverInfo.noticeFailure(proxy) serverInfo.noticeFailure(proxy)
} else { } else {