summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_message.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-04 20:01:49 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-04 20:01:49 +0400
commitab946cd1efd6b2ffcf1080d2a4f4c66dda811ef3 (patch)
treee8c37dce549de1785acd02e9a200521386026ea4 /src/lua/lua_message.c
parent36e8776498484a27af13a623ca1c78603ba6c7f6 (diff)
downloadrspamd-ab946cd1efd6b2ffcf1080d2a4f4c66dda811ef3.tar.gz
rspamd-ab946cd1efd6b2ffcf1080d2a4f4c66dda811ef3.zip
* Add asynchronous DNS resolver to lua API
* Add access to received headers to lua API * Some code polishing
Diffstat (limited to 'src/lua/lua_message.c')
-rw-r--r--src/lua/lua_message.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lua/lua_message.c b/src/lua/lua_message.c
index bef809230..12d3c05cb 100644
--- a/src/lua/lua_message.c
+++ b/src/lua/lua_message.c
@@ -111,6 +111,7 @@ lua_message_get_header (lua_State *L)
const char *headern;
GMimeMessage *obj = lua_check_message (L);
GList *res = NULL, *cur;
+ int i = 1;
if (obj != NULL) {
headern = luaL_checkstring (L, 2);
@@ -118,8 +119,10 @@ lua_message_get_header (lua_State *L)
res = message_get_header (NULL, obj, headern);
if (res) {
cur = res;
+ lua_newtable (L);
while (cur) {
lua_pushstring (L, (const char *)cur->data);
+ lua_rawseti(L, -2, i++);
g_free (cur->data);
cur = g_list_next (cur);
}
@@ -140,6 +143,7 @@ lua_message_get_header (lua_State *L)
return 1;
}
+
static int
lua_message_set_header (lua_State *L)
{