From: Vsevolod Stakhov Date: Sat, 30 Mar 2019 13:32:52 +0000 (+0000) Subject: [Minor] Improve errors handling X-Git-Tag: 1.9.1~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=12367efb629e74e792d4930d802e6178c4126a9b;p=rspamd.git [Minor] Improve errors handling --- 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; } }