diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-30 15:40:31 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-30 15:40:31 +0100 |
commit | 67761b737080a3e8f4a5ac8417258d6fcda05240 (patch) | |
tree | 2ed0a1a22d5c6593321af6d3e028db0a457b535f /src/controller.c | |
parent | d0a4d803ecfb7934ccd4e665e8b0919eaa2a8d3c (diff) | |
download | rspamd-67761b737080a3e8f4a5ac8417258d6fcda05240.tar.gz rspamd-67761b737080a3e8f4a5ac8417258d6fcda05240.zip |
[Project] Implement fast module ctx lookup
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/controller.c b/src/controller.c index 0f415210c..d41860937 100644 --- a/src/controller.c +++ b/src/controller.c @@ -3633,6 +3633,7 @@ start_controller_worker (struct rspamd_worker *worker) struct module_ctx *mctx; GHashTableIter iter; gpointer key, value; + guint i; struct rspamd_keypair_cache *cache; struct timeval stv; const guint save_stats_interval = 60 * 1000; /* 1 minute */ @@ -3792,9 +3793,7 @@ start_controller_worker (struct rspamd_worker *worker) rspamd_http_router_set_key (ctx->http, ctx->key); } - g_hash_table_iter_init (&iter, ctx->cfg->c_modules); - while (g_hash_table_iter_next (&iter, &key, &value)) { - mctx = value; + PTR_ARRAY_FOREACH (ctx->cfg->c_modules, i, mctx) { if (mctx->mod->module_attach_controller_func != NULL) { mctx->mod->module_attach_controller_func (mctx, ctx->custom_commands); |