summaryrefslogtreecommitdiffstats
path: root/src/libserver/worker_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-12 16:11:30 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-12 16:11:30 +0000
commit20c9bfdc2db1066ac174b462c5e9e48287b63ee7 (patch)
tree1773ef945f67c012bddd24ebb2a52244d29292b6 /src/libserver/worker_util.c
parentb4f9c4090f53a867f5a6eadff495c12f66e4e24c (diff)
downloadrspamd-20c9bfdc2db1066ac174b462c5e9e48287b63ee7.tar.gz
rspamd-20c9bfdc2db1066ac174b462c5e9e48287b63ee7.zip
More steps to support dynamic workers
Diffstat (limited to 'src/libserver/worker_util.c')
-rw-r--r--src/libserver/worker_util.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index b18c36ec9..41f6e3ef2 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -50,6 +50,7 @@ worker_t *
rspamd_get_worker_by_type (struct rspamd_config *cfg, GQuark type)
{
worker_t **pwrk, *wrk;
+ struct rspamd_dynamic_worker *dyn_wrk;
GList *cur;
pwrk = cfg->compiled_workers;
@@ -65,11 +66,15 @@ rspamd_get_worker_by_type (struct rspamd_config *cfg, GQuark type)
cur = g_list_first (cfg->dynamic_workers);
while (cur) {
- wrk = cur->data;
+ dyn_wrk = cur->data;
- if (rspamd_check_worker (cfg, wrk)) {
- if (g_quark_from_string (wrk->name) == type) {
- return wrk;
+ if (dyn_wrk->lib) {
+ wrk = &dyn_wrk->wrk;
+
+ if (rspamd_check_worker (cfg, wrk)) {
+ if (g_quark_from_string (wrk->name) == type) {
+ return wrk;
+ }
}
}