diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-04 20:01:49 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-04 20:01:49 +0400 |
commit | ab946cd1efd6b2ffcf1080d2a4f4c66dda811ef3 (patch) | |
tree | e8c37dce549de1785acd02e9a200521386026ea4 /src/lua/lua_message.c | |
parent | 36e8776498484a27af13a623ca1c78603ba6c7f6 (diff) | |
download | rspamd-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.c | 4 |
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) { |