From 12367efb629e74e792d4930d802e6178c4126a9b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 30 Mar 2019 13:32:52 +0000 Subject: [Minor] Improve errors handling --- contrib/librdns/resolver.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'contrib/librdns') 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; } } -- cgit v1.2.3