return dns_resolver;
}
+void
+rspamd_dns_resolver_deinit (struct rspamd_dns_resolver *resolver)
+{
+ if (resolver) {
+ if (resolver->r) {
+ rdns_resolver_release (resolver->r);
+ }
+
+ if (resolver->ups) {
+ rspamd_upstreams_destroy (resolver->ups);
+ }
+
+ g_free (resolver);
+ }
+}
+
static struct rdns_upstream_elt*
rspamd_dns_select_upstream (const char *name,
* Init DNS resolver, params are obtained from a config file or system file /etc/resolv.conf
*/
struct rspamd_dns_resolver *rspamd_dns_resolver_init (rspamd_logger_t *logger,
- struct ev_loop *ev_base, struct rspamd_config *cfg);
+ struct ev_loop *ev_base,
+ struct rspamd_config *cfg);
+
+void rspamd_dns_resolver_deinit (struct rspamd_dns_resolver *resolver);
struct rspamd_dns_request_ud;