commit 12367ef: [Minor] Improve errors handling

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Mar 30 13:35:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-30 13:32:52 +0000
URL: https://github.com/rspamd/rspamd/commit/12367efb629e74e792d4930d802e6178c4126a9b (HEAD -> master)

[Minor] Improve errors handling

---
 contrib/librdns/resolver.c | 12 ++++++++++--
 1 file 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;
 		}
 	}


More information about the Commits mailing list