diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-12 15:11:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-12 15:18:17 +0100 |
commit | e3412399bb82853e6e622188e683080791cf5de6 (patch) | |
tree | e8eb5a228a7f79da16780771610ca18126070c63 /src/lua/lua_trie.c | |
parent | 763627cbcb9ffcb0a29e94152fe4ff907099678c (diff) | |
download | rspamd-e3412399bb82853e6e622188e683080791cf5de6.tar.gz rspamd-e3412399bb82853e6e622188e683080791cf5de6.zip |
[Project] Adopt Lua API
Diffstat (limited to 'src/lua/lua_trie.c')
-rw-r--r-- | src/lua/lua_trie.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lua/lua_trie.c b/src/lua/lua_trie.c index e6a6052d4..bc90fef27 100644 --- a/src/lua/lua_trie.c +++ b/src/lua/lua_trie.c @@ -259,9 +259,7 @@ lua_trie_search_mime (lua_State *L) gboolean found = FALSE; if (trie && task) { - for (i = 0; i < task->text_parts->len; i ++) { - part = g_ptr_array_index (task->text_parts, i); - + PTR_ARRAY_FOREACH (MESSAGE_FIELD (task, text_parts), i, part) { if (!IS_PART_EMPTY (part) && part->utf_content != NULL) { text = part->utf_content->data; len = part->utf_content->len; @@ -327,9 +325,9 @@ lua_trie_search_rawbody (lua_State *L) gboolean found = FALSE; if (trie && task) { - if (task->raw_headers_content.len > 0) { - text = task->msg.begin + task->raw_headers_content.len; - len = task->msg.len - task->raw_headers_content.len; + if (MESSAGE_FIELD (task, raw_headers_content).len > 0) { + text = task->msg.begin + MESSAGE_FIELD (task, raw_headers_content).len; + len = task->msg.len - MESSAGE_FIELD (task, raw_headers_content).len; } else { /* Treat as raw message */ |