aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_mimepart.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-28 14:30:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-28 14:30:13 +0100
commit388c08c712c8279a52ad82caa213191352639ca9 (patch)
tree9f12bba4be9b9772044928949c920175fa89d072 /src/lua/lua_mimepart.c
parent61dbbe0eca5291b1329393a5fe1903fde415a243 (diff)
downloadrspamd-388c08c712c8279a52ad82caa213191352639ca9.tar.gz
rspamd-388c08c712c8279a52ad82caa213191352639ca9.zip
[Feature] Stop using of GLists for headers, improve performance
Diffstat (limited to 'src/lua/lua_mimepart.c')
-rw-r--r--src/lua/lua_mimepart.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c
index d519cccbe..a2b6cc49c 100644
--- a/src/lua/lua_mimepart.c
+++ b/src/lua/lua_mimepart.c
@@ -668,19 +668,22 @@ lua_mimepart_get_filename (lua_State * L)
static gint
lua_mimepart_get_header_common (lua_State *L, gboolean full, gboolean raw)
{
- gboolean strong = FALSE;
struct rspamd_mime_part *part = lua_check_mimepart (L);
const gchar *name;
+ GPtrArray *ar;
name = luaL_checkstring (L, 2);
if (name && part) {
- if (lua_gettop (L) == 3) {
- strong = lua_toboolean (L, 3);
- }
- return rspamd_lua_push_header (L, part->raw_headers, name, strong, full, raw);
+
+ ar = rspamd_message_get_header_from_hash (part->raw_headers, NULL,
+ name, FALSE);
+
+ return rspamd_lua_push_header (L, ar, name, FALSE, full, raw);
}
+
lua_pushnil (L);
+
return 1;
}