diff options
author | korgoth1 <vladislav.stakhov@gmail.com> | 2019-12-02 20:51:17 +0300 |
---|---|---|
committer | korgoth1 <vladislav.stakhov@gmail.com> | 2019-12-02 20:51:17 +0300 |
commit | ff4dadc87a5a6073001f4105f08c0e83578c80da (patch) | |
tree | 2d12b40395e1972077d9d66754138b3c7770b47b /src/lua/lua_task.c | |
parent | 388c82ffff6cf9dee3942212f5fc94f0230e211b (diff) | |
parent | e2dfcf15cc37650eee23ff00150bee9348ff11bb (diff) | |
download | rspamd-ff4dadc87a5a6073001f4105f08c0e83578c80da.tar.gz rspamd-ff4dadc87a5a6073001f4105f08c0e83578c80da.zip |
[Test] 115 Dmarc is now separated by 115 dmarc, 116 dkim, 117 spf.
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r-- | src/lua/lua_task.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index aff6d8499..26ad15dec 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -4889,14 +4889,19 @@ lua_task_get_timeval (lua_State *L) 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)tv.tv_sec); - lua_settable (L, -3); - lua_pushstring (L, "tv_usec"); - lua_pushinteger (L, (lua_Integer)tv.tv_usec); - lua_settable (L, -3); + if (lua_isboolean (L, 2) && !!lua_toboolean (L, 2)) { + lua_pushnumber (L, task->task_timestamp); + } + else { + double_to_tv (task->task_timestamp, &tv); + lua_createtable (L, 0, 2); + lua_pushstring (L, "tv_sec"); + lua_pushinteger (L, (lua_Integer) tv.tv_sec); + lua_settable (L, -3); + lua_pushstring (L, "tv_usec"); + lua_pushinteger (L, (lua_Integer) tv.tv_usec); + lua_settable (L, -3); + } } else { return luaL_error (L, "invalid arguments"); |