commit b00071d: [Minor] Store map pointer in a backend structure

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Feb 12 13:07:05 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-02-12 13:02:59 +0000
URL: https://github.com/rspamd/rspamd/commit/b00071d015999d500116ff026b209a7f4d758cdb

[Minor] Store map pointer in a backend structure

---
 src/libserver/maps/map.c         | 3 +++
 src/libserver/maps/map_private.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
index fae277bcd..6348ca8b2 100644
--- a/src/libserver/maps/map.c
+++ b/src/libserver/maps/map.c
@@ -2802,6 +2802,7 @@ rspamd_map_add (struct rspamd_config *cfg,
 
 	rspamd_map_calculate_hash (map);
 	msg_info_map ("added map %s", bk->uri);
+	bk->map = map;
 
 	cfg->maps = g_list_prepend (cfg->maps, map);
 
@@ -2842,6 +2843,8 @@ rspamd_map_add_backend (struct rspamd_map *map, struct rspamd_map_backend *bk)
 	else {
 		g_ptr_array_add (map->backends, bk);
 	}
+
+	bk->map = map;
 }
 
 struct rspamd_map*
diff --git a/src/libserver/maps/map_private.h b/src/libserver/maps/map_private.h
index 37def8c18..4c0805e3a 100644
--- a/src/libserver/maps/map_private.h
+++ b/src/libserver/maps/map_private.h
@@ -115,11 +115,14 @@ union rspamd_map_backend_data {
 	struct static_map_data *sd;
 };
 
+
+struct rspamd_map;
 struct rspamd_map_backend {
 	enum fetch_proto protocol;
 	gboolean is_signed;
 	gboolean is_compressed;
 	gboolean is_fallback;
+	struct rspamd_map *map;
 	struct ev_loop *event_loop;
 	guint32 id;
 	struct rspamd_cryptobox_pubkey *trusted_pubkey;


More information about the Commits mailing list