]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve errors handling
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 30 Mar 2019 13:32:52 +0000 (13:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 30 Mar 2019 13:32:52 +0000 (13:32 +0000)
contrib/librdns/resolver.c

index 5f15d242c76524e3fdc107435fb3ad6b67b95b97..3130a5c964d788d471d7ad4789b62a1bfcef424d 100644 (file)
@@ -718,7 +718,7 @@ rdns_make_request_full (
        }
 
        req->async = resolver->async;
-retry:
+
        if (resolver->ups) {
                struct rdns_upstream_elt *elt;
 
@@ -757,8 +757,16 @@ retry:
                r = rdns_send_request (req, req->io->sock, true);
 
                if (r == -1) {
-                       rdns_info ("cannot send DNS request");
+                       rdns_info ("cannot send DNS request: %s", strerror (errno));
                        REF_RELEASE (req);
+
+                       if (resolver->ups && serv->ups_elt) {
+                               resolver->ups->fail (serv->ups_elt, resolver->ups->data);
+                       }
+                       else {
+                               UPSTREAM_FAIL (serv, time (NULL));
+                       }
+
                        return NULL;
                }
        }