aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-30 15:44:45 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-30 15:44:45 +0100
commit9806fa5b247edaafe0a541639c347504c2b19890 (patch)
tree03f358a04aec13253baa7a94099cf2aa02a15866 /src/libstat/stat_process.c
parent81d0a5ac60177ae6a3ffeabea741f6c68ed4670a (diff)
downloadrspamd-9806fa5b247edaafe0a541639c347504c2b19890.tar.gz
rspamd-9806fa5b247edaafe0a541639c347504c2b19890.zip
[Fix] Fix conditional learning
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index dc0018429..1c8fbf070 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -484,6 +484,7 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
while (cur) {
cb_ref = GPOINTER_TO_INT (cur->data);
+ lua_settop (L, 0);
lua_rawgeti (L, LUA_REGISTRYINDEX, cb_ref);
/* Push task and two booleans: is_spam and is_unlearn */
ptask = lua_newuserdata (L, sizeof (*ptask));
@@ -509,7 +510,7 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
}
lua_settop (L, 0);
- continue; /* Go to the next classifier */
+ break;
}
}
}
@@ -518,6 +519,10 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
cur = g_list_next (cur);
}
+ if (conditionally_skipped) {
+ break;
+ }
+
if (cl->subrs->learn_spam_func (cl, task->tokens, task, spam,
task->flags & RSPAMD_TASK_FLAG_UNLEARN, err)) {
learned = TRUE;