aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/spf.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-30 15:40:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-30 15:40:31 +0100
commit67761b737080a3e8f4a5ac8417258d6fcda05240 (patch)
tree2ed0a1a22d5c6593321af6d3e028db0a457b535f /src/plugins/spf.c
parentd0a4d803ecfb7934ccd4e665e8b0919eaa2a8d3c (diff)
downloadrspamd-67761b737080a3e8f4a5ac8417258d6fcda05240.tar.gz
rspamd-67761b737080a3e8f4a5ac8417258d6fcda05240.zip
[Project] Implement fast module ctx lookup
Diffstat (limited to 'src/plugins/spf.c')
-rw-r--r--src/plugins/spf.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index 683683a55..5ec5bfcfc 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -62,13 +62,6 @@ struct spf_ctx {
gboolean check_authed;
};
-static inline struct spf_ctx *
-spf_get_context (struct rspamd_config *cfg)
-{
- return (struct spf_ctx *)g_hash_table_lookup (cfg->c_modules, "spf");
-}
-
-
static void spf_symbol_callback (struct rspamd_task *task, void *unused);
/* Initialization */
@@ -77,14 +70,23 @@ gint spf_module_config (struct rspamd_config *cfg);
gint spf_module_reconfig (struct rspamd_config *cfg);
module_t spf_module = {
- "spf",
- spf_module_init,
- spf_module_config,
- spf_module_reconfig,
- NULL,
- RSPAMD_MODULE_VER
+ "spf",
+ spf_module_init,
+ spf_module_config,
+ spf_module_reconfig,
+ NULL,
+ RSPAMD_MODULE_VER,
+ (guint)-1,
};
+static inline struct spf_ctx *
+spf_get_context (struct rspamd_config *cfg)
+{
+ return (struct spf_ctx *)g_ptr_array_index (cfg->c_modules,
+ spf_module.ctx_offset);
+}
+
+
gint
spf_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{