aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libmime/message.c5
-rw-r--r--src/libmime/message.h15
2 files changed, 17 insertions, 3 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index 7c7609cf8..7d2d81a7f 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -1069,10 +1069,11 @@ rspamd_message_dtor (struct rspamd_message *msg)
}
}
- if (p->part_type == RSPAMD_MIME_PART_CUSTOM_LUA && p->specific.lua_ref != -1) {
+ if (p->part_type == RSPAMD_MIME_PART_CUSTOM_LUA &&
+ p->specific.lua_specific.cbref != -1) {
luaL_unref (msg->task->cfg->lua_state,
LUA_REGISTRYINDEX,
- p->specific.lua_ref);
+ p->specific.lua_specific.cbref);
}
}
diff --git a/src/libmime/message.h b/src/libmime/message.h
index 7f6ea86dd..c11b273eb 100644
--- a/src/libmime/message.h
+++ b/src/libmime/message.h
@@ -65,6 +65,19 @@ struct rspamd_mime_multipart {
rspamd_ftok_t boundary;
};
+enum rspamd_lua_specific_type {
+ RSPAMD_LUA_PART_TEXT,
+ RSPAMD_LUA_PART_STRING,
+ RSPAMD_LUA_PART_TABLE,
+ RSPAMD_LUA_PART_FUNCTION,
+ RSPAMD_LUA_PART_UNKNOWN,
+};
+
+struct rspamd_lua_specific_part {
+ gint cbref;
+ enum rspamd_lua_specific_type type;
+};
+
struct rspamd_mime_part {
struct rspamd_content_type *ct;
struct rspamd_content_type *detected_ct;
@@ -91,7 +104,7 @@ struct rspamd_mime_part {
struct rspamd_mime_text_part *txt;
struct rspamd_image *img;
struct rspamd_archive *arch;
- gint lua_ref;
+ struct rspamd_lua_specific_part lua_specific;
} specific;
guchar digest[rspamd_cryptobox_HASHBYTES];