aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/fuzzy_check.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-11-10 09:05:31 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-11-10 09:05:31 +0000
commit17f77784f8d8b895f0f10208bb8b1b52669d195d (patch)
treec330c7e408f975b2859a91c382d2960f5940a040 /src/plugins/fuzzy_check.c
parentaca7d247ccd1d1c6abbd96fc0b18f8d613b9a101 (diff)
downloadrspamd-17f77784f8d8b895f0f10208bb8b1b52669d195d.tar.gz
rspamd-17f77784f8d8b895f0f10208bb8b1b52669d195d.zip
[Minor] Fix events mess
Diffstat (limited to 'src/plugins/fuzzy_check.c')
-rw-r--r--src/plugins/fuzzy_check.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 2576586c4..4c93d1de5 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -2762,7 +2762,7 @@ fuzzy_check_io_callback(gint fd, short what, void *arg)
static void
-fuzzy_lua_fin(void *ud)
+fuzzy_controller_lua_fin(void *ud)
{
struct fuzzy_learn_session *session = ud;
@@ -2793,7 +2793,7 @@ fuzzy_controller_timer_callback(gint fd, short what, void *arg)
session->rule->retransmits);
if (session->session) {
- rspamd_session_remove_event(session->session, fuzzy_lua_fin,
+ rspamd_session_remove_event(session->session, fuzzy_controller_lua_fin,
session);
}
else {
@@ -3019,7 +3019,7 @@ fuzzy_controller_io_callback(gint fd, short what, void *arg)
}
else {
/* Lua handler */
- rspamd_session_remove_event(session->session, fuzzy_lua_fin, session);
+ rspamd_session_remove_event(session->session, fuzzy_controller_lua_fin, session);
}
return;
@@ -3782,7 +3782,7 @@ fuzzy_check_send_lua_learn(struct fuzzy_rule *rule,
rule->io_timeout);
rspamd_session_add_event(task->s,
- fuzzy_lua_fin,
+ fuzzy_controller_lua_fin,
s,
M);
@@ -4415,7 +4415,7 @@ fuzzy_lua_session_is_completed(struct fuzzy_lua_session *session)
if (nreplied == session->commands->len) {
- rspamd_session_remove_event(session->task->s, fuzzy_io_fin, session);
+ rspamd_session_remove_event(session->task->s, fuzzy_lua_session_fin, session);
return TRUE;
}
@@ -4426,15 +4426,12 @@ fuzzy_lua_session_is_completed(struct fuzzy_lua_session *session)
static gint
fuzzy_lua_try_read(struct fuzzy_lua_session *session)
{
- struct rspamd_task *task;
const struct rspamd_fuzzy_reply *rep;
struct rspamd_fuzzy_cmd *cmd = NULL;
struct fuzzy_cmd_io *io = NULL;
gint r, ret;
guchar buf[2048], *p;
- task = session->task;
-
if ((r = read(session->fd, buf, sizeof(buf) - 1)) == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
return 0;
@@ -4544,7 +4541,7 @@ fuzzy_lua_io_callback(gint fd, short what, void *arg)
&session->ev, EV_READ);
}
else if (ret == return_error) {
- rspamd_session_remove_event(session->task->s, fuzzy_io_fin, session);
+ rspamd_session_remove_event(session->task->s, fuzzy_lua_session_fin, session);
}
else {
/* Read something from network */