diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-18 16:27:25 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-22 10:57:29 +0100 |
commit | d5a36f4f750e63294cefed10f55b29fe7409bba6 (patch) | |
tree | 0cebfb90d8a004a6e5d261077f72be05a32101a7 /src/lua/lua_task.c | |
parent | 4b75d23d067118e2874ec3b8726d49e3f185b811 (diff) | |
download | rspamd-d5a36f4f750e63294cefed10f55b29fe7409bba6.tar.gz rspamd-d5a36f4f750e63294cefed10f55b29fe7409bba6.zip |
[Project] Another iteration
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r-- | src/lua/lua_task.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 11ee6b32a..0ffe4b8c5 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -4309,7 +4309,7 @@ lua_task_get_date (lua_State *L) } /* Get GMT date and store it to time_t */ if (type == DATE_CONNECT || type == DATE_CONNECT_STRING) { - tim = (tv_to_msec (&task->tv)) / 1000.; + tim = task->task_timestamp; if (!gmt) { struct tm t; @@ -4399,14 +4399,16 @@ lua_task_get_timeval (lua_State *L) { LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); + struct timeval tv; if (task != NULL) { + double_to_tv (task->task_timestamp, &tv); lua_createtable (L, 0, 2); lua_pushstring (L, "tv_sec"); - lua_pushinteger (L, (lua_Integer)task->tv.tv_sec); + lua_pushinteger (L, (lua_Integer)tv.tv_sec); lua_settable (L, -3); lua_pushstring (L, "tv_usec"); - lua_pushinteger (L, (lua_Integer)task->tv.tv_usec); + lua_pushinteger (L, (lua_Integer)tv.tv_usec); lua_settable (L, -3); } else { @@ -4429,7 +4431,7 @@ lua_task_get_scan_time (lua_State *L) } rspamd_task_set_finish_time (task); - lua_pushnumber (L, task->time_real_finish - task->time_real); + lua_pushnumber (L, task->time_real_finish - task->task_timestamp); lua_pushnumber (L, task->time_virtual_finish - task->time_virtual); if (!set) { |