summaryrefslogtreecommitdiffstats
path: root/src/libutil/upstream.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-15 13:45:53 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-15 13:45:53 +0000
commit612bbd0102d0090b753de4ccc10147461e4a3932 (patch)
tree5b11fee5bbbbc8fff680dddb2960df11f94a0a8f /src/libutil/upstream.c
parente7d1c7c1a609761ce46f0a6f7cdc7709a4ba2df8 (diff)
downloadrspamd-612bbd0102d0090b753de4ccc10147461e4a3932.tar.gz
rspamd-612bbd0102d0090b753de4ccc10147461e4a3932.zip
[Feature] Allow iterating over upstreams
Diffstat (limited to 'src/libutil/upstream.c')
-rw-r--r--src/libutil/upstream.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c
index 3d0121572..a49a8a222 100644
--- a/src/libutil/upstream.c
+++ b/src/libutil/upstream.c
@@ -889,3 +889,18 @@ rspamd_upstream_get_data (struct upstream *up)
{
return up->data;
}
+
+
+void
+rspamd_upstreams_foreach (struct upstream_list *ups,
+ rspamd_upstream_traverse_func cb, void *ud)
+{
+ struct upstream *up;
+ guint i;
+
+ for (i = 0; i < ups->ups->len; i ++) {
+ up = g_ptr_array_index (ups->ups, i);
+
+ cb (up, ud);
+ }
+}