*/
struct rspamd_controller_worker_ctx {
guint64 magic;
- guint32 timeout;
- struct timeval io_tv;
- /* DNS resolver */
- struct rspamd_dns_resolver *resolver;
/* Events base */
struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
+ /* END OF COMMON PART */
+ guint32 timeout;
+ struct timeval io_tv;
/* Whether we use ssl for this server */
gboolean use_ssl;
/* Webui password */
time_t start_time;
/* Main server */
struct rspamd_main *srv;
- /* Configuration */
- struct rspamd_config *cfg;
/* SSL cert */
gchar *ssl_cert;
/* SSL private key */
struct rspamd_fuzzy_storage_ctx {
guint64 magic;
+ /* Events base */
+ struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
+ /* END OF COMMON PART */
struct fuzzy_global_stat stat;
char *hashfile;
gdouble expire;
const ucl_object_t *masters_map;
GHashTable *master_flags;
guint keypair_cache_size;
- struct event_base *ev_base;
gint peer_fd;
struct event peer_ev;
struct event stat_ev;
guint updates_failed;
guint updates_maxfail;
guint32 collection_id;
- struct rspamd_dns_resolver *resolver;
- struct rspamd_config *cfg;
struct rspamd_worker *worker;
struct rspamd_http_connection_router *collection_rt;
guchar cookie[COOKIE_SIZE];
*/
struct hs_helper_ctx {
guint64 magic;
+ /* Events base */
+ struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
+ /* END OF COMMON PART */
gchar *hs_dir;
gboolean loaded;
gdouble max_time;
gdouble recompile_time;
- struct rspamd_config *cfg;
struct event recompile_timer;
- struct event_base *ev_base;
};
static gpointer
*/
struct log_helper_ctx {
guint64 magic;
- struct rspamd_config *cfg;
+ /* Events base */
struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
+ /* END OF COMMON PART */
struct event log_ev;
struct rspamd_worker_lua_script *scripts;
- struct rspamd_dns_resolver *resolver;
lua_State *L;
gint pair[2];
};
*/
struct rspamd_lua_worker_ctx {
guint64 magic;
- /* DNS resolver */
- struct rspamd_dns_resolver *resolver;
/* Events base */
struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
+ /* END OF COMMON PART */
/* Other params */
GHashTable *params;
/* Lua script to load */
gint cbref_accept;
/* Callback for finishing */
gint cbref_fin;
- /* Config file */
- struct rspamd_config *cfg;
/* The rest options */
ucl_object_t *opts;
};
struct rspamd_abstract_worker_ctx {
guint64 magic;
+ /* Events base */
+ struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
char data[];
};
struct rspamd_proxy_ctx {
guint64 magic;
- gdouble timeout;
- struct timeval io_tv;
- struct rspamd_config *cfg;
- /* DNS resolver */
- struct rspamd_dns_resolver *resolver;
/* Events base */
struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
+ /* END OF COMMON PART */
+ gdouble timeout;
+ struct timeval io_tv;
/* Encryption key for clients */
struct rspamd_cryptobox_keypair *key;
/* Keys cache */
{
struct rspamd_task *task;
struct rspamd_config *cfg = worker->srv->cfg;
- struct rspamd_worker_ctx *ctx;
+ struct rspamd_abstract_worker_ctx *ctx;
struct rspamd_config_post_load_script *sc;
if (cfg->finish_callbacks) {
struct rspamd_worker_ctx {
guint64 magic;
+ /* Events base */
+ struct event_base *ev_base;
+ /* DNS resolver */
+ struct rspamd_dns_resolver *resolver;
+ /* Config */
+ struct rspamd_config *cfg;
+
guint32 timeout;
struct timeval io_tv;
/* Detect whether this worker is mime worker */
gboolean is_json;
/* Allow learning throught worker */
gboolean allow_learn;
- /* DNS resolver */
- struct rspamd_dns_resolver *resolver;
/* Limit of tasks */
guint32 max_tasks;
/* Maximum time for task processing */
gdouble task_timeout;
- /* Events base */
- struct event_base *ev_base;
/* Encryption key */
struct rspamd_cryptobox_keypair *key;
/* Keys cache */
struct rspamd_keypair_cache *keys_cache;
- /* Configuration */
- struct rspamd_config *cfg;
};
/*