rspamd_upstreams_library_config (worker->srv->cfg, worker->srv->cfg->ups_ctx,
ctx->ev_base, ctx->resolver->r);
/* Maps events */
- rspamd_map_watch (worker->srv->cfg, ctx->ev_base);
+ rspamd_map_watch (worker->srv->cfg, ctx->ev_base, ctx->resolver);
rspamd_symbols_cache_start_refresh (worker->srv->cfg->cache, ctx->ev_base);
rspamd_stat_init (worker->srv->cfg, ctx->ev_base);
rspamd_lru_hash_t *errors_ips;
struct rspamd_fuzzy_backend *backend;
GQueue *updates_pending;
+ struct rspamd_dns_resolver *resolver;
};
enum fuzzy_cmd_type {
}
/* Maps events */
- rspamd_map_watch (worker->srv->cfg, ctx->ev_base);
+ ctx->resolver = dns_resolver_init (worker->srv->logger,
+ ctx->ev_base,
+ worker->srv->cfg);
+ rspamd_map_watch (worker->srv->cfg, ctx->ev_base, ctx->resolver);
/* Get peer pipe */
memset (&srv_cmd, 0, sizeof (srv_cmd));
ctx->ev_base = rspamd_prepare_worker (worker, "http_proxy",
proxy_accept_socket);
- rspamd_map_watch (worker->srv->cfg, ctx->ev_base);
-
-
ctx->resolver = dns_resolver_init (worker->srv->logger,
ctx->ev_base,
worker->srv->cfg);
double_to_tv (ctx->timeout, &ctx->io_tv);
+ rspamd_map_watch (worker->srv->cfg, ctx->ev_base, ctx->resolver);
rspamd_upstreams_library_config (worker->srv->cfg, ctx->cfg->ups_ctx,
ctx->ev_base, ctx->resolver->r);
/* Start watching event for all maps */
void
rspamd_map_watch (struct rspamd_config *cfg,
- struct rspamd_dns_resolver *resolver,
- struct event_base *ev_base)
+ struct event_base *ev_base,
+ struct rspamd_dns_resolver *resolver)
{
GList *cur = cfg->maps;
struct rspamd_map *map;
* Start watching of maps by adding events to libevent event loop
*/
void rspamd_map_watch (struct rspamd_config *cfg,
- struct rspamd_dns_resolver *resolver,
- struct event_base *ev_base);
+ struct event_base *ev_base,
+ struct rspamd_dns_resolver *resolver);
/**
* Remove all maps watched (remove events)
}
/* Maps events */
- rspamd_map_watch (worker->srv->cfg, ctx->ev_base);
+ rspamd_map_watch (worker->srv->cfg, ctx->ev_base, ctx->resolver);
event_base_loop (ctx->ev_base, 0);
rspamd_worker_block_signals ();
ctx->ev_base = rspamd_prepare_worker (worker, "normal", accept_socket);
msec_to_tv (ctx->timeout, &ctx->io_tv);
-
- rspamd_map_watch (worker->srv->cfg, ctx->ev_base);
rspamd_symbols_cache_start_refresh (worker->srv->cfg->cache, ctx->ev_base);
ctx->resolver = dns_resolver_init (worker->srv->logger,
ctx->ev_base,
worker->srv->cfg);
+ rspamd_map_watch (worker->srv->cfg, ctx->ev_base, ctx->resolver);
rspamd_upstreams_library_config (worker->srv->cfg, ctx->cfg->ups_ctx,
ctx->ev_base, ctx->resolver->r);