commit f91e090: [Fix] Cleanup session on exit

Vsevolod Stakhov vsevolod at rspamd.com
Fri Nov 10 13:49:12 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-11-10 09:34:40 +0000
URL: https://github.com/rspamd/rspamd/commit/f91e0903f1bbe25db96fedcdda29d3dfb65a5bfb

[Fix] Cleanup session on exit

---
 src/rspamadm/lua_repl.c | 8 +++++---
 src/rspamadm/rspamadm.c | 7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/rspamadm/lua_repl.c b/src/rspamadm/lua_repl.c
index bc1291a21..432c4de76 100644
--- a/src/rspamadm/lua_repl.c
+++ b/src/rspamadm/lua_repl.c
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2016 Vsevolod Stakhov
+/*
+ * Copyright 2023 Vsevolod Stakhov
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *    http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -288,6 +288,8 @@ wait_session_events(void)
 	while (rspamd_session_events_pending(rspamadm_session) > 0) {
 		ev_loop(rspamd_main->event_loop, EVRUN_ONCE);
 	}
+
+	msg_debug("finished events waiting, terminating session");
 }
 
 gint lua_repl_thread_call(struct thread_entry *thread, gint narg, gpointer ud, lua_thread_error_t error_func)
diff --git a/src/rspamadm/rspamadm.c b/src/rspamadm/rspamadm.c
index 22a875c1e..58f2da308 100644
--- a/src/rspamadm/rspamadm.c
+++ b/src/rspamadm/rspamadm.c
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2016 Vsevolod Stakhov
+/*
+ * Copyright 2023 Vsevolod Stakhov
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *    http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -604,6 +604,7 @@ gint main(gint argc, gchar **argv, gchar **env)
 	ev_break(rspamd_main->event_loop, EVBREAK_ALL);
 
 end:
+	rspamd_session_destroy(rspamadm_session);
 	g_option_context_free(context);
 	rspamd_dns_resolver_deinit(resolver);
 	REF_RELEASE(rspamd_main->cfg);


More information about the Commits mailing list