From b56ea3dcdf09355681bd824c290a6373aee0180a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 16 Sep 2009 16:01:20 +0400 Subject: [PATCH] * Remove assert * Fix build WITH_LUA * Fix calling of classifier * Fix autolearn --- CMakeLists.txt | 1 + src/classifiers/winnow.c | 8 +++++--- src/filter.c | 2 +- src/map.c | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5e2363cb..7428c13b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,7 @@ IF(ENABLE_LUA MATCHES "ON") # Automatic check failed, check passed variable IF(LUA_INCLUDE_DIR) INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") + SET(WITH_LUA 1) ELSE(LUA_INCLUDE_DIR) SET(ENABLE_LUA "OFF") MESSAGE(STATUS "Lua not found, lua support disabled") diff --git a/src/classifiers/winnow.c b/src/classifiers/winnow.c index 88298faf4..94b342525 100644 --- a/src/classifiers/winnow.c +++ b/src/classifiers/winnow.c @@ -184,7 +184,9 @@ winnow_learn (struct classifier_ctx *ctx, statfile_pool_t *pool, char *symbol, G cur = g_list_next (cur); } - statfile_pool_lock_file (pool, data.file); - g_tree_foreach (input, learn_callback, &data); - statfile_pool_unlock_file (pool, data.file); + if (data.file != NULL) { + statfile_pool_lock_file (pool, data.file); + g_tree_foreach (input, learn_callback, &data); + statfile_pool_unlock_file (pool, data.file); + } } diff --git a/src/filter.c b/src/filter.c index c9453dc61..96faabd66 100644 --- a/src/filter.c +++ b/src/filter.c @@ -464,7 +464,7 @@ process_autolearn (struct statfile *st, struct worker_task *task, GTree *tokens, } } - classifier->learn_func (ctx, task->worker->srv->statfile_pool, filename, tokens, TRUE); + classifier->learn_func (ctx, task->worker->srv->statfile_pool, st->symbol, tokens, TRUE); } } } diff --git a/src/map.c b/src/map.c index f878e59b1..cbe8e5026 100644 --- a/src/map.c +++ b/src/map.c @@ -239,7 +239,6 @@ read_http_chunked (u_char *buf, size_t len, struct rspamd_map *map, struct http_ p = buf + (len - (data->chunk_read - data->chunk)); if (*p != '\r') { msg_info ("read_http_chunked: invalid chunked reply"); - g_assert (0); return FALSE; } p += 2; -- 2.39.5