diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-01-16 20:59:37 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-01-16 20:59:37 +0400 |
commit | 9bacf0d835d66aaddcdb9e664a34364f25ed2554 (patch) | |
tree | 8aa7287724a3abce1b6b63dc7215e101d44eb87d /src/main.h | |
parent | 9f2cb66ccbce8cd0fb659b79063bcebf1d816a1d (diff) | |
download | rspamd-9bacf0d835d66aaddcdb9e664a34364f25ed2554.tar.gz rspamd-9bacf0d835d66aaddcdb9e664a34364f25ed2554.zip |
* Introduce new system of worker's and modules initialization:
- Removed legacy limitation of worker's types;
- Using GQuarks to identify workers and modules;
- Remove modules.sh script;
- Add a common system of workers and modules;
- Write management and configuration for new architecture.
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/main.h b/src/main.h index ada9d97e4..63a94b462 100644 --- a/src/main.h +++ b/src/main.h @@ -49,7 +49,7 @@ struct rspamd_worker { gboolean is_dying; /**< if worker is going to shutdown */ gboolean pending; /**< if worker is pending to run */ struct rspamd_main *srv; /**< pointer to server structure */ - enum process_type type; /**< process type */ + GQuark type; /**< process type */ struct event sig_ev_usr1; /**< signals event */ struct event sig_ev_usr2; /**< signals event */ struct event bind_ev; /**< socket events */ @@ -57,6 +57,10 @@ struct rspamd_worker { gpointer ctx; /**< worker's specific data */ }; +/** + * Module + */ + struct pidfh; struct config_file; struct tokenizer; @@ -88,8 +92,8 @@ struct rspamd_main { struct config_file *cfg; /**< pointer to config structure */ pid_t pid; /**< main pid */ /* Pid file structure */ - rspamd_pidfh_t *pfh; /**< struct pidfh for pidfile */ - enum process_type type; /**< process type */ + rspamd_pidfh_t *pfh; /**< struct pidfh for pidfile */ + GQuark type; /**< process type */ guint ev_initialized; /**< is event system is initialized */ struct rspamd_stat *stat; /**< pointer to statistics */ @@ -262,23 +266,12 @@ struct c_module { struct module_ctx *ctx; /**< pointer to context */ }; -/* Workers' initialization and start functions */ -gpointer init_worker (void); -void start_worker (struct rspamd_worker *worker); -gpointer init_controller (void); -void start_controller (struct rspamd_worker *worker); - /** * Register custom controller function */ void register_custom_controller_command (const gchar *name, controller_func_t handler, gboolean privilleged, gboolean require_message); /** - * Initialize context for worker of specified type - */ -gpointer init_workers_ctx (enum process_type type); - -/** * If set, reopen log file on next write */ extern struct rspamd_main *rspamd_main; |