aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dkim_check.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-10 16:01:46 -0400
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-10 16:01:46 -0400
commit4339d364297d0c0976631278771ff32a70a2af19 (patch)
tree55859d4d62131e5bd791b6f330f0c9f96d1e4791 /src/plugins/dkim_check.c
parentfef4d3d8361893b6d49bafa7e0e524dcb110fdab (diff)
downloadrspamd-4339d364297d0c0976631278771ff32a70a2af19.tar.gz
rspamd-4339d364297d0c0976631278771ff32a70a2af19.zip
Fix dependencies in case of dkim plugin.
Diffstat (limited to 'src/plugins/dkim_check.c')
-rw-r--r--src/plugins/dkim_check.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index 9787ac5a5..0cd1d554f 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -74,6 +74,7 @@ struct dkim_check_result {
struct rspamd_task *task;
gint res;
gint mult_allow, mult_deny;
+ struct rspamd_async_watcher *w;
struct dkim_check_result *next, *prev, *first;
};
@@ -330,7 +331,7 @@ dkim_module_check (struct dkim_check_result *res)
}
}
- if (cur->res == -1) {
+ if (cur->res == -1 || cur->key == NULL) {
/* Still need a key */
all_done = FALSE;
}
@@ -381,6 +382,10 @@ dkim_module_check (struct dkim_check_result *res)
sel->ctx->domain)));
}
}
+
+ if (all_done && res != NULL) {
+ rspamd_session_watcher_pop (res->task->s, res->w);
+ }
}
static void
@@ -442,6 +447,7 @@ dkim_symbol_callback (struct rspamd_task *task, void *unused)
if (res == NULL) {
res = rspamd_mempool_alloc0 (task->task_pool, sizeof (*res));
res->prev = res;
+ res->w = rspamd_session_get_watcher (task->s);
cur = res;
}
else {
@@ -515,6 +521,7 @@ dkim_symbol_callback (struct rspamd_task *task, void *unused)
}
if (res != NULL) {
+ rspamd_session_watcher_push (task->s);
dkim_module_check (res);
}
}