Skip to content

Commit

Permalink
Remove deprecated temporary error (#377)
Browse files Browse the repository at this point in the history
* removed temporary status

* removed unused statuses
  • Loading branch information
phillip-stephens authored Jun 5, 2024
1 parent c192044 commit 9635bda
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
3 changes: 0 additions & 3 deletions src/zdns/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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{
Expand Down
4 changes: 1 addition & 3 deletions src/zdns/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/zdns/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9635bda

Please sign in to comment.