aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/map_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/map_private.h')
-rw-r--r--src/libutil/map_private.h69
1 files changed, 36 insertions, 33 deletions
diff --git a/src/libutil/map_private.h b/src/libutil/map_private.h
index f1a9d22e4..55641f3dd 100644
--- a/src/libutil/map_private.h
+++ b/src/libutil/map_private.h
@@ -49,17 +49,48 @@ enum fetch_proto {
MAP_PROTO_STATIC
};
+/**
+ * Data specific to file maps
+ */
+struct file_map_data {
+ gchar *filename;
+ struct stat st;
+};
+
+/**
+ * Data specific to HTTP maps
+ */
+struct http_map_data {
+ gchar *path;
+ gchar *host;
+ gchar *last_signature;
+ rspamd_fstring_t *etag;
+ time_t last_modified;
+ time_t last_checked;
+ gboolean request_sent;
+ guint64 gen;
+ guint16 port;
+};
+
+struct static_map_data {
+ guchar *data;
+ gsize len;
+ gboolean processed;
+};
+
+union rspamd_map_backend_data {
+ struct file_map_data *fd;
+ struct http_map_data *hd;
+ struct static_map_data *sd;
+};
+
struct rspamd_map_backend {
enum fetch_proto protocol;
gboolean is_signed;
gboolean is_compressed;
guint32 id;
struct rspamd_cryptobox_pubkey *trusted_pubkey;
- union {
- struct file_map_data *fd;
- struct http_map_data *hd;
- struct static_map_data *sd;
- } data;
+ union rspamd_map_backend_data data;
gchar *uri;
ref_entry_t ref;
};
@@ -96,34 +127,6 @@ struct rspamd_map {
gpointer dtor_data;
};
-/**
- * Data specific to file maps
- */
-struct file_map_data {
- gchar *filename;
- struct stat st;
-};
-
-/**
- * Data specific to HTTP maps
- */
-struct http_map_data {
- gchar *path;
- gchar *host;
- gchar *last_signature;
- time_t last_modified;
- time_t last_checked;
- gboolean request_sent;
- guint64 gen;
- guint16 port;
-};
-
-struct static_map_data {
- guchar *data;
- gsize len;
- gboolean processed;
-};
-
enum rspamd_map_http_stage {
map_resolve_host2 = 0, /* 2 requests sent */
map_resolve_host1, /* 1 requests sent */