aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-08 22:04:36 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-08 22:04:36 +0100
commitc1c8dba96ef13bfc8725a5142d751601c48c6719 (patch)
tree03b0921667029da36e23194074b84029e80c56df /src/plugins
parent6538f7ff7c62de807adca85e5db49d7cccab67d4 (diff)
downloadrspamd-c1c8dba96ef13bfc8725a5142d751601c48c6719.tar.gz
rspamd-c1c8dba96ef13bfc8725a5142d751601c48c6719.zip
[Feature] Use heap in LRU caches
Signed-off-by: Vsevolod Stakhov <vsevolod@highsecure.ru>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dkim_check.c12
-rw-r--r--src/plugins/spf.c21
2 files changed, 4 insertions, 29 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index 7852ddd6c..ee62eb50e 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -222,7 +222,7 @@ dkim_module_config (struct rspamd_config *cfg)
const ucl_object_t *value;
const gchar *str;
gint res = TRUE, cb_id;
- guint cache_size, cache_expire;
+ guint cache_size;
gboolean got_trusted = FALSE;
if (!rspamd_config_is_module_enabled (cfg, "dkim")) {
@@ -261,14 +261,7 @@ dkim_module_config (struct rspamd_config *cfg)
else {
cache_size = DEFAULT_CACHE_SIZE;
}
- if ((value =
- rspamd_config_get_module_opt (cfg, "dkim",
- "dkim_cache_expire")) != NULL) {
- cache_expire = ucl_obj_todouble (value);
- }
- else {
- cache_expire = DEFAULT_CACHE_MAXAGE;
- }
+
if ((value =
rspamd_config_get_module_opt (cfg, "dkim", "time_jitter")) != NULL) {
dkim_module_ctx->time_jitter = ucl_obj_todouble (value);
@@ -364,7 +357,6 @@ dkim_module_config (struct rspamd_config *cfg)
dkim_module_ctx->dkim_hash = rspamd_lru_hash_new (
cache_size,
- cache_expire,
g_free, /* Keys are just C-strings */
dkim_module_key_dtor);
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index edad4bfc9..a71958b4c 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -153,15 +153,6 @@ spf_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
0,
NULL,
0);
- rspamd_rcl_add_doc_by_path (cfg,
- "spf",
- "Maximum lifetime for the elements in the SPF cache",
- "spf_cache_expire",
- UCL_TIME,
- NULL,
- 0,
- NULL,
- 0);
return 0;
}
@@ -172,7 +163,7 @@ spf_module_config (struct rspamd_config *cfg)
{
const ucl_object_t *value;
gint res = TRUE, cb_id;
- guint cache_size, cache_expire;
+ guint cache_size;
const gchar *str;
if (!rspamd_config_is_module_enabled (cfg, "spf")) {
@@ -216,14 +207,7 @@ spf_module_config (struct rspamd_config *cfg)
else {
cache_size = DEFAULT_CACHE_SIZE;
}
- if ((value =
- rspamd_config_get_module_opt (cfg, "spf",
- "spf_cache_expire")) != NULL) {
- cache_expire = ucl_obj_toint (value);
- }
- else {
- cache_expire = DEFAULT_CACHE_MAXAGE;
- }
+
if ((value =
rspamd_config_get_module_opt (cfg, "spf", "whitelist")) != NULL) {
@@ -265,7 +249,6 @@ spf_module_config (struct rspamd_config *cfg)
spf_module_ctx->spf_hash = rspamd_lru_hash_new (
cache_size,
- cache_expire,
NULL,
(GDestroyNotify)spf_record_unref);