aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-12 12:35:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-12 12:35:13 +0100
commitd4d921a97e5a8548fb506ed8bc747d9a2bc37561 (patch)
treeb3647b472e4e08680d0ce4464a353a5cbc05a35a /src/libmime
parent22ef30cfeca05d3eaa6fc570959232798cc82de3 (diff)
downloadrspamd-d4d921a97e5a8548fb506ed8bc747d9a2bc37561.tar.gz
rspamd-d4d921a97e5a8548fb506ed8bc747d9a2bc37561.zip
[Rework] Rename filter.h to a more sane name
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/CMakeLists.txt2
-rw-r--r--src/libmime/scan_result.c (renamed from src/libmime/filter.c)22
-rw-r--r--src/libmime/scan_result.h (renamed from src/libmime/filter.h)12
-rw-r--r--src/libmime/scan_result_private.h (renamed from src/libmime/filter_private.h)8
4 files changed, 22 insertions, 22 deletions
diff --git a/src/libmime/CMakeLists.txt b/src/libmime/CMakeLists.txt
index 81d75d382..a011dff07 100644
--- a/src/libmime/CMakeLists.txt
+++ b/src/libmime/CMakeLists.txt
@@ -2,7 +2,7 @@
SET(LIBRSPAMDMIMESRC
${CMAKE_CURRENT_SOURCE_DIR}/email_addr.c
${CMAKE_CURRENT_SOURCE_DIR}/mime_expressions.c
- ${CMAKE_CURRENT_SOURCE_DIR}/filter.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/scan_result.c
${CMAKE_CURRENT_SOURCE_DIR}/images.c
${CMAKE_CURRENT_SOURCE_DIR}/message.c
${CMAKE_CURRENT_SOURCE_DIR}/archives.c
diff --git a/src/libmime/filter.c b/src/libmime/scan_result.c
index a193f5f78..428a2da71 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/scan_result.c
@@ -15,12 +15,12 @@
*/
#include "config.h"
#include "mem_pool.h"
-#include "filter.h"
+#include "scan_result.h"
#include "rspamd.h"
#include "message.h"
#include "lua/lua_common.h"
#include "libserver/cfg_file_private.h"
-#include "libmime/filter_private.h"
+#include "libmime/scan_result_private.h"
#include <math.h>
#include "contrib/uthash/utlist.h"
@@ -35,9 +35,9 @@ INIT_LOG_MODULE(metric)
static struct rspamd_counter_data symbols_count;
static void
-rspamd_metric_result_dtor (gpointer d)
+rspamd_scan_result_dtor (gpointer d)
{
- struct rspamd_metric_result *r = (struct rspamd_metric_result *)d;
+ struct rspamd_scan_result *r = (struct rspamd_scan_result *)d;
struct rspamd_symbol_result sres;
rspamd_set_counter_ema (&symbols_count, kh_size (r->symbols), 0.5);
@@ -51,10 +51,10 @@ rspamd_metric_result_dtor (gpointer d)
kh_destroy (rspamd_symbols_group_hash, r->sym_groups);
}
-struct rspamd_metric_result *
+struct rspamd_scan_result *
rspamd_create_metric_result (struct rspamd_task *task)
{
- struct rspamd_metric_result *metric_res;
+ struct rspamd_scan_result *metric_res;
guint i;
metric_res = task->result;
@@ -64,7 +64,7 @@ rspamd_create_metric_result (struct rspamd_task *task)
}
metric_res = rspamd_mempool_alloc0 (task->task_pool,
- sizeof (struct rspamd_metric_result));
+ sizeof (struct rspamd_scan_result));
metric_res->symbols = kh_init (rspamd_symbols_hash);
metric_res->sym_groups = kh_init (rspamd_symbols_group_hash);
@@ -98,7 +98,7 @@ rspamd_create_metric_result (struct rspamd_task *task)
}
rspamd_mempool_add_destructor (task->task_pool,
- rspamd_metric_result_dtor,
+ rspamd_scan_result_dtor,
metric_res);
return metric_res;
@@ -120,7 +120,7 @@ rspamd_add_passthrough_result (struct rspamd_task *task,
const gchar *module,
guint flags)
{
- struct rspamd_metric_result *metric_res;
+ struct rspamd_scan_result *metric_res;
struct rspamd_passthrough_result *pr;
metric_res = task->result;
@@ -185,7 +185,7 @@ insert_metric_result (struct rspamd_task *task,
const gchar *opt,
enum rspamd_symbol_insert_flags flags)
{
- struct rspamd_metric_result *metric_res;
+ struct rspamd_scan_result *metric_res;
struct rspamd_symbol_result *s = NULL;
gdouble final_score, *gr_score = NULL, next_gf = 1.0, diff;
struct rspamd_symbol *sdef;
@@ -560,7 +560,7 @@ rspamd_check_action_metric (struct rspamd_task *task)
struct rspamd_passthrough_result *pr;
double max_score = -(G_MAXDOUBLE), sc;
int i;
- struct rspamd_metric_result *mres = task->result;
+ struct rspamd_scan_result *mres = task->result;
gboolean seen_least = FALSE;
if (mres->passthrough_result != NULL) {
diff --git a/src/libmime/filter.h b/src/libmime/scan_result.h
index 8245f8c53..b5f76baf7 100644
--- a/src/libmime/filter.h
+++ b/src/libmime/scan_result.h
@@ -1,10 +1,10 @@
/**
- * @file filter.h
- * Filters logic implementation
+ * @file scan_result.h
+ * Scan result holder
*/
-#ifndef RSPAMD_FILTER_H
-#define RSPAMD_FILTER_H
+#ifndef RSPAMD_SCAN_RESULT_H
+#define RSPAMD_SCAN_RESULT_H
#include "config.h"
#include "rspamd_symcache.h"
@@ -70,7 +70,7 @@ struct kh_rspamd_symbols_hash_s;
struct kh_rspamd_symbols_group_hash_s;
-struct rspamd_metric_result {
+struct rspamd_scan_result {
double score; /**< total score */
double grow_factor; /**< current grow factor */
struct rspamd_passthrough_result *passthrough_result;
@@ -89,7 +89,7 @@ struct rspamd_metric_result {
* @param task task object
* @return metric result or NULL if metric `name` has not been found
*/
-struct rspamd_metric_result *rspamd_create_metric_result (struct rspamd_task *task);
+struct rspamd_scan_result *rspamd_create_metric_result (struct rspamd_task *task);
/**
* Adds a new passthrough result to a task
diff --git a/src/libmime/filter_private.h b/src/libmime/scan_result_private.h
index 31def75e2..aa90430e1 100644
--- a/src/libmime/filter_private.h
+++ b/src/libmime/scan_result_private.h
@@ -2,10 +2,10 @@
// Created by Vsevolod Stakhov on 2019-01-14.
//
-#ifndef RSPAMD_FILTER_PRIVATE_H
-#define RSPAMD_FILTER_PRIVATE_H
+#ifndef RSPAMD_SCAN_RESULT_PRIVATE_H
+#define RSPAMD_SCAN_RESULT_PRIVATE_H
-#include "filter.h"
+#include "scan_result.h"
#include "contrib/libucl/khash.h"
#ifdef __cplusplus
@@ -36,4 +36,4 @@ KHASH_INIT (rspamd_symbols_group_hash,
}
#endif
-#endif //RSPAMD_FILTER_PRIVATE_H
+#endif //RSPAMD_SCAN_RESULT_PRIVATE_H