]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
* Remove assert
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 16 Sep 2009 12:01:20 +0000 (16:01 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 16 Sep 2009 12:01:20 +0000 (16:01 +0400)
* Fix build WITH_LUA
* Fix calling of classifier
* Fix autolearn

CMakeLists.txt
src/classifiers/winnow.c
src/filter.c
src/map.c

index e5e2363cb337082328ff0bb4887f362c85f5480b..7428c13b40d9cb1b52d14d1b69546f93f3a6e283 100644 (file)
@@ -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")
index 88298faf471adc7220b46fc274b68557e956e2f8..94b342525866761b87e89a9ee8203de96211e2e0 100644 (file)
@@ -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);
+       }
 }
index c9453dc61dba4743a54b18ed43468e595fbefc29..96faabd66819fdf1cdffab1bcb9f8d31c092d61b 100644 (file)
@@ -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);
                }
        }
 }
index f878e59b1f79e0bc9b7aec58eb588e67c93ad8bd..cbe8e502685bcaf2dc86cefaf3fd0944777b9fcc 100644 (file)
--- 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;