diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-14 12:51:54 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-14 12:51:54 +0100 |
commit | 1af89c35663dd364c8d46523f0d71adc64f8bde4 (patch) | |
tree | 1a814dea5f5ce6045bd53f2e802dd3eb87123ca0 /src/libstat/backends/redis_backend.c | |
parent | 0478b4ee28138a886f9b457bdba7f2897e151093 (diff) | |
download | rspamd-1af89c35663dd364c8d46523f0d71adc64f8bde4.tar.gz rspamd-1af89c35663dd364c8d46523f0d71adc64f8bde4.zip |
[Fix] Add fail-safety for destroying sessions
Diffstat (limited to 'src/libstat/backends/redis_backend.c')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 69c14e167..5510cff05 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -1572,6 +1572,9 @@ rspamd_redis_process_tokens (struct rspamd_task *task, gint ret; const gchar *learned_key = "learns"; + if (rspamd_session_is_destroying (task->s)) { + return FALSE; + } if (tokens == NULL || tokens->len == 0 || rt->redis == NULL) { return FALSE; @@ -1664,6 +1667,10 @@ rspamd_redis_learn_tokens (struct rspamd_task *task, GPtrArray *tokens, goffset off; const gchar *learned_key = "learns"; + if (rspamd_session_is_destroying (task->s)) { + return FALSE; + } + up = rspamd_upstream_get (rt->ctx->write_servers, RSPAMD_UPSTREAM_MASTER_SLAVE, NULL, |