{
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);
+ }
+}
gboolean rspamd_upstreams_from_ucl (struct upstream_list *ups,
const ucl_object_t *in, guint16 def_port, void *data);
+
+typedef void (*rspamd_upstream_traverse_func) (struct upstream *up,
+ void *ud);
+
+/**
+ * Traverse upstreams list calling the function specified
+ * @param ups
+ * @param cb
+ * @param ud
+ */
+void rspamd_upstreams_foreach (struct upstream_list *ups,
+ rspamd_upstream_traverse_func cb, void *ud);
+
/**
* Returns the current IP address of the upstream
* @param up