aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-30 15:19:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-30 15:19:04 +0000
commit39c853952b97d56726839e6e5681cd7e1849c364 (patch)
tree500ec6cf01f380fb22308159c290e0901310d892 /src/lua/lua_task.c
parentef18538d25cc8e39fd0eb71424cecef516412d90 (diff)
downloadrspamd-39c853952b97d56726839e6e5681cd7e1849c364.tar.gz
rspamd-39c853952b97d56726839e6e5681cd7e1849c364.zip
Rework message store to allow encryption.
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r--src/lua/lua_task.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 98aba7f15..ef52b4544 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -716,7 +716,9 @@ lua_task_create_from_buffer (lua_State *L)
ptask = lua_newuserdata (L, sizeof (gpointer));
rspamd_lua_setclass (L, "rspamd{task}", -1);
*ptask = task;
- task->msg = g_string_new_len (data, len);
+ task->msg.start = rspamd_mempool_alloc (task->task_pool, len + 1);
+ memcpy ((gpointer)task->msg.start, data, len);
+ task->msg.len = len;
}
return 1;
}
@@ -726,7 +728,7 @@ lua_task_process_message (lua_State *L)
{
struct rspamd_task *task = lua_check_task (L);
- if (task != NULL && task->msg != NULL && task->msg->len > 0) {
+ if (task != NULL && task->msg.len > 0) {
if (process_message (task) == 0) {
lua_pushboolean (L, TRUE);
}