From 9635bda3f883eb2090a9f77d9a9ba693361d30e7 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 5 Jun 2024 15:00:46 -0700 Subject: [PATCH] Remove deprecated temporary error (#377) * removed temporary status * removed unused statuses --- src/zdns/conf.go | 3 --- src/zdns/lookup.go | 4 +--- src/zdns/util.go | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/zdns/conf.go b/src/zdns/conf.go index b40e0b97..c24e6390 100644 --- a/src/zdns/conf.go +++ b/src/zdns/conf.go @@ -38,7 +38,6 @@ const ( STATUS_FORMERR Status = "FORMERR" // Format Error STATUS_SERVFAIL Status = "SERVFAIL" STATUS_NXDOMAIN Status = "NXDOMAIN" - STATUS_NOTIMP Status = "NOT_IMPL" STATUS_REFUSED Status = "REFUSED" STATUS_TRUNCATED Status = "TRUNCATED" @@ -51,9 +50,7 @@ const ( STATUS_ILLEGAL_INPUT Status = "ILLEGAL_INPUT" STATUS_TIMEOUT Status = "TIMEOUT" STATUS_ITER_TIMEOUT Status = "ITERATIVE_TIMEOUT" - STATUS_TEMPORARY Status = "TEMPORARY" STATUS_NOAUTH Status = "NOAUTH" - STATUS_NODATA Status = "NODATA" ) var RootServers = [...]string{ diff --git a/src/zdns/lookup.go b/src/zdns/lookup.go index 4f6fd37e..7e4a88ff 100644 --- a/src/zdns/lookup.go +++ b/src/zdns/lookup.go @@ -291,7 +291,7 @@ func (r *Resolver) retryingLookup(q Question, nameServer string, recursive bool) for i := 0; i <= r.retries; i++ { result, status, err := wireLookup(r.udpClient, r.tcpClient, r.conn, q, nameServer, recursive, r.ednsOptions, r.dnsSecEnabled, r.checkingDisabledBit) - if (status != STATUS_TIMEOUT && status != STATUS_TEMPORARY) || i == r.retries { + if status != STATUS_TIMEOUT || i == r.retries { return result, status, (i + 1), err } if r.udpClient != nil { @@ -347,8 +347,6 @@ func wireLookup(udp *dns.Client, tcp *dns.Client, conn *dns.Conn, q Question, na if nerr, ok := err.(net.Error); ok { if nerr.Timeout() { return res, STATUS_TIMEOUT, nil - } else if nerr.Temporary() { - return res, STATUS_TEMPORARY, err } } return res, STATUS_ERROR, err diff --git a/src/zdns/util.go b/src/zdns/util.go index 059973a9..960f7904 100644 --- a/src/zdns/util.go +++ b/src/zdns/util.go @@ -177,8 +177,6 @@ func handleStatus(status *Status, err error) (*Status, error) { return status, nil case STATUS_ILLEGAL_INPUT: return status, nil - case STATUS_TEMPORARY: - return status, nil default: var s *Status return s, nil