aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/upstream.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-03 10:19:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-03 10:19:13 +0000
commitbb6169400ef16b3dd4d54b171849b3d7877c651e (patch)
tree4f62814815e47e98aacb628b2e75caa9b033ce99 /src/libutil/upstream.h
parent00a71b1315eb60bbb62876b2927fa49ab2720d2b (diff)
downloadrspamd-bb6169400ef16b3dd4d54b171849b3d7877c651e.tar.gz
rspamd-bb6169400ef16b3dd4d54b171849b3d7877c651e.zip
Use upstreams configuration.
Diffstat (limited to 'src/libutil/upstream.h')
-rw-r--r--src/libutil/upstream.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libutil/upstream.h b/src/libutil/upstream.h
index f6f711034..812cc4bd8 100644
--- a/src/libutil/upstream.h
+++ b/src/libutil/upstream.h
@@ -13,6 +13,8 @@ enum rspamd_upstream_rotation {
RSPAMD_UPSTREAM_MASTER_SLAVE
};
+
+struct rspamd_config;
/* Opaque upstream structures */
struct upstream;
struct upstream_list;
@@ -25,6 +27,12 @@ void rspamd_upstreams_library_init (struct rdns_resolver *resolver,
struct event_base *base);
/**
+ * Configure attributes of upstreams library
+ * @param cfg
+ */
+void rspamd_upstreams_library_config (struct rspamd_config *cfg);
+
+/**
* Upstream error logic
* 1. During error time we count upstream_ok and upstream_fail
* 2. If failcount is more then maxerrors then we mark upstream as unavailable for dead time
@@ -61,6 +69,13 @@ void rspamd_upstreams_destroy (struct upstream_list *ups);
gsize rspamd_upstreams_count (struct upstream_list *ups);
/**
+ * Returns the number of upstreams in the list
+ * @param ups
+ * @return
+ */
+gsize rspamd_upstreams_alive (struct upstream_list *ups);
+
+/**
* Add upstream from the string
* @param ups upstream list
* @param str string in format "name[:port[:priority]]"