From: Vsevolod Stakhov Date: Mon, 16 Dec 2013 13:22:07 +0000 (+0400) Subject: Do not break lua plugins if there is no DNS. X-Git-Tag: 0.6.4~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aa1438ae5a373d9775c228443e30da6e41df8ae9;p=rspamd.git Do not break lua plugins if there is no DNS. --- diff --git a/src/dns.c b/src/dns.c index b479ac576..9328c57a7 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1435,6 +1435,10 @@ make_dns_request (struct rspamd_dns_resolver *resolver, gint r; struct dns_header *header; + /* If no DNS servers defined silently return FALSE */ + if (resolver->servers_num == 0) { + return FALSE; + } /* Check throttling */ if (resolver->throttling) { return FALSE; @@ -1629,7 +1633,7 @@ dns_resolver_init (struct event_base *ev_base, struct config_file *cfg) /* Parse resolv.conf */ if (! parse_resolv_conf (new) || new->servers_num == 0) { msg_err ("cannot parse resolv.conf and no nameservers defined, so no ways to resolve addresses"); - return NULL; + return new; } } else { @@ -1684,7 +1688,7 @@ dns_resolver_init (struct event_base *ev_base, struct config_file *cfg) msg_err ("no valid nameservers defined, try to parse resolv.conf"); if (! parse_resolv_conf (new) || new->servers_num == 0) { msg_err ("cannot parse resolv.conf and no nameservers defined, so no ways to resolve addresses"); - return NULL; + return new; } }