From f3b6712e04fd993caccaa18e425639d85d81b1eb Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 21 Aug 2008 17:58:30 +0400 Subject: * 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 --- main.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'main.h') 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); -- cgit v1.2.3