aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/events.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-26 17:50:35 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-26 17:50:35 +0000
commitff74d742158c985d4e59655f6989e68a024122d7 (patch)
treef150883001b5766ff76eb6d60edfabaaa3abc313 /src/libserver/events.c
parent62c2acacbb8edf6cb58b16daaf98004d93711bd1 (diff)
downloadrspamd-ff74d742158c985d4e59655f6989e68a024122d7.tar.gz
rspamd-ff74d742158c985d4e59655f6989e68a024122d7.zip
Implement forced timeout for delayed filters
Issue: #452
Diffstat (limited to 'src/libserver/events.c')
-rw-r--r--src/libserver/events.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/libserver/events.c b/src/libserver/events.c
index d94149584..45ca50ce4 100644
--- a/src/libserver/events.c
+++ b/src/libserver/events.c
@@ -227,9 +227,7 @@ rspamd_session_destroy (struct rspamd_async_session *session)
}
session->flags |= RSPAMD_SESSION_FLAG_DESTROYING;
- g_hash_table_foreach_remove (session->events,
- rspamd_session_destroy_callback,
- session);
+ rspamd_session_cleanup (session);
if (session->cleanup != NULL) {
session->cleanup (session->user_data);
@@ -238,6 +236,19 @@ rspamd_session_destroy (struct rspamd_async_session *session)
return TRUE;
}
+void
+rspamd_session_cleanup (struct rspamd_async_session *session)
+{
+ if (session == NULL) {
+ msg_info_session ("session is NULL");
+ return;
+ }
+
+ g_hash_table_foreach_remove (session->events,
+ rspamd_session_destroy_callback,
+ session);
+}
+
gboolean
rspamd_session_pending (struct rspamd_async_session *session)
{