diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-06-05 18:21:49 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-06-05 18:21:49 +0400 |
commit | 35cb2b6e2f17a518d0c940985e6e19b41fdedf19 (patch) | |
tree | 18b4c1bd7ddea5af8eb580333c6ac1e5f0e00ebb /src/worker.c | |
parent | 1d8da7cd96a810bc6119a8f604e934235e68f9cf (diff) | |
download | rspamd-35cb2b6e2f17a518d0c940985e6e19b41fdedf19.tar.gz rspamd-35cb2b6e2f17a518d0c940985e6e19b41fdedf19.zip |
* Split rspamd build to several independent libraries to reduce overhead.
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/worker.c b/src/worker.c index 250bf7d31..1da4458d7 100644 --- a/src/worker.c +++ b/src/worker.c @@ -251,6 +251,27 @@ construct_task (struct rspamd_worker *worker) return new_task; } +/** + * Return worker's control structure by its type + * @param type + * @return worker's control structure or NULL + */ +worker_t* +get_worker_by_type (GQuark type) +{ + worker_t **cur; + + cur = &workers[0]; + while (*cur) { + if (g_quark_from_string ((*cur)->name) == type) { + return *cur; + } + cur ++; + } + + return NULL; +} + /* * Free all structures of worker_task |