commit 5512bbb: [Minor] Set table index
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Oct 15 10:49:08 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-10-15 11:31:56 +0100
URL: https://github.com/rspamd/rspamd/commit/5512bbb2c7506b5fea638bc2f4d242362b8976c5
[Minor] Set table index
---
src/lua/lua_mimepart.c | 2 ++
src/lua/lua_task.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c
index 5c0c80c2d..1f6a62f40 100644
--- a/src/lua/lua_mimepart.c
+++ b/src/lua/lua_mimepart.c
@@ -1725,11 +1725,13 @@ lua_mimepart_get_headers (lua_State *L)
if (part) {
struct rspamd_mime_header *cur;
+ int i = 1;
lua_createtable (L, rspamd_mime_headers_count(part->raw_headers), 0);
LL_FOREACH2(part->headers_order, cur, ord_next) {
rspamd_lua_push_header_array(L, cur->name, cur, RSPAMD_TASK_HEADER_PUSH_FULL,
need_modified);
+ lua_rawseti(L, -2, i++);
}
}
else {
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 7f9eb0343..3d81391b0 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -3130,11 +3130,13 @@ lua_task_get_headers (lua_State *L)
if (task && task->message) {
struct rspamd_mime_header *cur;
+ int i = 1;
lua_createtable (L, rspamd_mime_headers_count(MESSAGE_FIELD(task, raw_headers)), 0);
LL_FOREACH2(MESSAGE_FIELD(task, headers_order), cur, ord_next) {
rspamd_lua_push_header_array(L, cur->name, cur, RSPAMD_TASK_HEADER_PUSH_FULL,
need_modified);
+ lua_rawseti(L, -2, i++);
}
}
else {
More information about the Commits
mailing list