aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-14 21:29:35 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-14 21:29:35 +0300
commit63cb7c0f364df3331df235f38f1be901f04bebba (patch)
tree7f3115d88ffb5d477c5f79403cdb90eb79871a36 /src/lua
parent9dcd8232a2326b951f9d7fc8d7063a89a4312468 (diff)
downloadrspamd-63cb7c0f364df3331df235f38f1be901f04bebba.tar.gz
rspamd-63cb7c0f364df3331df235f38f1be901f04bebba.zip
Optimization.
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_task.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index eb95f0258..f161eca5e 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -466,7 +466,7 @@ lua_dns_callback (struct rspamd_dns_reply *reply, gpointer arg)
cur = reply->elements;
while (cur) {
elt = cur->data;
- memcpy (&ina, elt->a.addr, sizeof (in_addr_t));
+ memcpy (&ina, &elt->a.addr[0], sizeof (struct in_addr));
/* Actually this copy memory, so using of inet_ntoa is valid */
lua_pushstring (cd->L, inet_ntoa (ina));
lua_rawseti (cd->L, -2, ++i);
@@ -474,7 +474,7 @@ lua_dns_callback (struct rspamd_dns_reply *reply, gpointer arg)
}
lua_pushnil (cd->L);
}
- else if (reply->type == DNS_REQUEST_A) {
+ else if (reply->type == DNS_REQUEST_PTR) {
lua_newtable (cd->L);
cur = reply->elements;
while (cur) {
@@ -811,16 +811,9 @@ static gint
lua_task_get_recipients_headers (lua_State *L)
{
struct worker_task *task = lua_check_task (L);
- InternetAddressList *addrs;
if (task) {
- addrs = g_mime_message_get_all_recipients(task->message);
- lua_push_internet_address (L, addrs);
-#ifndef GMIME24
- internet_address_list_destroy (addrs);
-#else
- g_object_unref (addrs);
-#endif
+ lua_push_internet_address (L, task->rcpts);
return 1;
}