aboutsummaryrefslogtreecommitdiffstats
path: root/main.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2008-08-21 17:58:30 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2008-08-21 17:58:30 +0400
commitf3b6712e04fd993caccaa18e425639d85d81b1eb (patch)
treeaaa504a733d1c442692a8e25ad5680657de71942 /main.h
parente90352d20a0d5f615c906b7719f95599cb2aaeac (diff)
downloadrspamd-f3b6712e04fd993caccaa18e425639d85d81b1eb.tar.gz
rspamd-f3b6712e04fd993caccaa18e425639d85d81b1eb.zip
* Add filters logic
* Perl should use separate memcached context for its operations (just do memcpy with the same socket) TODO: add block mechanics here to avoid memcached connection closing before perl operation is finished * Change logic of perl chain filter
Diffstat (limited to 'main.h')
-rw-r--r--main.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.h b/main.h
index cb98167ae..fdf22b8ba 100644
--- a/main.h
+++ b/main.h
@@ -59,6 +59,7 @@ struct pidfh;
struct config_file;
struct filter_chain;
+
/* Struct that determine main server object (for logging purposes) */
struct rspamd_main {
struct config_file *cfg;
@@ -78,6 +79,14 @@ struct filter_result {
TAILQ_ENTRY (filter_result) next;
};
+struct chain_result {
+ struct filter_chain *chain;
+ int *marks;
+ unsigned int marks_num;
+ int result_mark;
+ TAILQ_ENTRY (chain_result) next;
+};
+
struct mime_part {
GMimeContentType *type;
GByteArray *content;
@@ -114,6 +123,22 @@ struct worker_task {
TAILQ_HEAD (uriq, uri) urls;
/* List of filter results */
TAILQ_HEAD (resultsq, filter_result) results;
+ /* Results of all chains */
+ TAILQ_HEAD (chainsq, chain_result) chain_results;
+ struct config_file *cfg;
+};
+
+struct module_ctx {
+ int (*header_filter)(struct worker_task *task);
+ int (*mime_filter)(struct worker_task *task);
+ int (*message_filter)(struct worker_task *task);
+ int (*url_filter)(struct worker_task *task);
+};
+
+struct c_module {
+ const char *name;
+ struct module_ctx *ctx;
+ LIST_ENTRY (c_module) next;
};
void start_worker (struct rspamd_worker *worker, int listen_sock);