]> granicus.if.org Git - libevent/commitdiff
treat SERVERFAILED as a timeout; from tor cvs via Nick Mathewson
authorNiels Provos <provos@gmail.com>
Mon, 28 May 2007 21:17:35 +0000 (21:17 +0000)
committerNiels Provos <provos@gmail.com>
Mon, 28 May 2007 21:17:35 +0000 (21:17 +0000)
svn:r359

evdns.c

diff --git a/evdns.c b/evdns.c
index f66239bbceaa734f45e0b588245efca3ab64ad28..82b45a7f47e517f08dc0e3a68af78e80f693515a 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -698,7 +698,6 @@ reply_handle(struct request *const req, u16 flags, u32 ttl, struct reply *reply)
                }
 
                switch(error) {
-               case DNS_ERR_SERVERFAILED:
                case DNS_ERR_NOTIMPL:
                case DNS_ERR_REFUSED:
                        // we regard these errors as marking a bad nameserver
@@ -710,6 +709,14 @@ reply_handle(struct request *const req, u16 flags, u32 ttl, struct reply *reply)
                                if (!request_reissue(req)) return;
                        }
                        break;
+               case DNS_ERR_SERVERFAILED:
+                       // rcode 2 (servfailed) sometimes means "we are broken" and
+                       // sometimes (with some binds) means "that request was very
+                       // confusing."  Treat this as a timeout, not a failure.
+                       log(EVDNS_LOG_DEBUG, "Got a SERVERFAILED from nameserver %s; "
+                               "will allow the request to time out.",
+                               debug_ntoa(req->ns->address));
+                       break;
                default:
                        // we got a good reply from the nameserver
                        nameserver_up(req->ns);