aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-07-20 18:42:29 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-07-20 18:42:29 +0100
commit8abd76b18ff391376fff2f6652a7f9711d7766d2 (patch)
treef0467d461f4fccb1c2dfe30b0f19ad4f15d98129 /src/main.h
parent7522608cb80dc227c05f4e254ba13e9f86d7a07f (diff)
downloadrspamd-8abd76b18ff391376fff2f6652a7f9711d7766d2.tar.gz
rspamd-8abd76b18ff391376fff2f6652a7f9711d7766d2.zip
Allow listening on multiply addresses.
Now rspamd can listen on multiply ipv4/ipv6 addresses. Removed legacy workers (lmtp, kvstorage) as they are never used in production. Try to unify workers initialization.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h
index 521e0740a..052c6ce6d 100644
--- a/src/main.h
+++ b/src/main.h
@@ -53,7 +53,7 @@ struct rspamd_worker {
GQuark type; /**< process type */
struct event sig_ev_usr1; /**< signals event */
struct event sig_ev_usr2; /**< signals event */
- struct event bind_ev; /**< socket events */
+ GList *accept_events; /**< socket events */
struct worker_conf *cf; /**< worker config data */
gpointer ctx; /**< worker's specific data */
};
@@ -321,6 +321,31 @@ void free_task_soft (gpointer ud);
*/
double set_counter (const gchar *name, guint32 value);
+#ifndef HAVE_SA_SIGINFO
+typedef void (*rspamd_sig_handler_t) (gint);
+#else
+typedef void (*rspamd_sig_handler_t) (gint, siginfo_t *, void *);
+#endif
+
+/**
+ * Prepare worker's startup
+ * @param worker worker structure
+ * @param name name of the worker
+ * @param sig_handler handler of main signals
+ * @param accept_handler handler of accept event for listen sockets
+ * @return event base suitable for a worker
+ */
+struct event_base *
+prepare_worker (struct rspamd_worker *worker, const char *name,
+ rspamd_sig_handler_t sig_handler,
+ void (*accept_handler)(evutil_socket_t, short, void *));
+
+/**
+ * Stop accepting new connections for a worker
+ * @param worker
+ */
+void worker_stop_accept (struct rspamd_worker *worker);
+
#endif
/*