aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/learn_cache
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-14 12:51:54 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-14 12:51:54 +0100
commit1af89c35663dd364c8d46523f0d71adc64f8bde4 (patch)
tree1a814dea5f5ce6045bd53f2e802dd3eb87123ca0 /src/libstat/learn_cache
parent0478b4ee28138a886f9b457bdba7f2897e151093 (diff)
downloadrspamd-1af89c35663dd364c8d46523f0d71adc64f8bde4.tar.gz
rspamd-1af89c35663dd364c8d46523f0d71adc64f8bde4.zip
[Fix] Add fail-safety for destroying sessions
Diffstat (limited to 'src/libstat/learn_cache')
-rw-r--r--src/libstat/learn_cache/redis_cache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c
index d43ec3665..e17f20d27 100644
--- a/src/libstat/learn_cache/redis_cache.c
+++ b/src/libstat/learn_cache/redis_cache.c
@@ -438,6 +438,10 @@ rspamd_stat_cache_redis_check (struct rspamd_task *task,
struct timeval tv;
gchar *h;
+ if (rspamd_session_is_destroying (task->s)) {
+ return RSPAMD_LEARN_INGORE;
+ }
+
h = rspamd_mempool_get_variable (task->task_pool, "words_hash");
if (h == NULL) {
@@ -469,6 +473,10 @@ rspamd_stat_cache_redis_learn (struct rspamd_task *task,
gchar *h;
gint flag;
+ if (rspamd_session_is_destroying (task->s)) {
+ return RSPAMD_LEARN_INGORE;
+ }
+
h = rspamd_mempool_get_variable (task->task_pool, "words_hash");
g_assert (h != NULL);