summaryrefslogtreecommitdiffstats
path: root/contrib/librdns
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-30 13:32:52 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-30 13:32:52 +0000
commit12367efb629e74e792d4930d802e6178c4126a9b (patch)
treeda9c24607193cd0023eee4a0270c0c2838d61693 /contrib/librdns
parent6dd638eafa3413f1adc77b483c0dc51d2cb86750 (diff)
downloadrspamd-12367efb629e74e792d4930d802e6178c4126a9b.tar.gz
rspamd-12367efb629e74e792d4930d802e6178c4126a9b.zip
[Minor] Improve errors handling
Diffstat (limited to 'contrib/librdns')
-rw-r--r--contrib/librdns/resolver.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/librdns/resolver.c b/contrib/librdns/resolver.c
index 5f15d242c..3130a5c96 100644
--- a/contrib/librdns/resolver.c
+++ b/contrib/librdns/resolver.c
@@ -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;
}
}