diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-17 16:03:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-17 16:03:22 +0100 |
commit | 45a1c1e24ac3ac96b8207c9c83ba397114223c4f (patch) | |
tree | 15a68bbe37da4d30afc58b693a4a08dcc115ae89 /src/lua/lua_common.h | |
parent | ed77fe58566345ed84bd4db9fc5313c246e5ff99 (diff) | |
download | rspamd-45a1c1e24ac3ac96b8207c9c83ba397114223c4f.tar.gz rspamd-45a1c1e24ac3ac96b8207c9c83ba397114223c4f.zip |
[Rework] Make lua_redis task agnostic
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r-- | src/lua/lua_common.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h index 3f2fa6ba5..de6965414 100644 --- a/src/lua/lua_common.h +++ b/src/lua/lua_common.h @@ -204,6 +204,7 @@ gint rspamd_lua_push_header (lua_State * L, * Check for task at the specified position */ struct rspamd_task *lua_check_task (lua_State * L, gint pos); +struct rspamd_task *lua_check_task_maybe (lua_State * L, gint pos); struct rspamd_lua_map *lua_check_map (lua_State * L, gint pos); @@ -243,8 +244,6 @@ void luaopen_http (lua_State * L); void luaopen_redis (lua_State * L); void luaopen_upstream (lua_State * L); void luaopen_mempool (lua_State * L); -void luaopen_session (lua_State * L); -void luaopen_io_dispatcher (lua_State * L); void luaopen_dns_resolver (lua_State * L); void luaopen_rsa (lua_State * L); void luaopen_ip (lua_State * L); @@ -280,6 +279,8 @@ void rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg); struct memory_pool_s * rspamd_lua_check_mempool (lua_State * L, gint pos); struct rspamd_config * lua_check_config (lua_State * L, gint pos); +struct rspamd_async_session* lua_check_session (lua_State * L, gint pos); +struct event_base* lua_check_ev_base (lua_State * L, gint pos); /** * Extract an arguments from lua table according to format string. Supported arguments are: @@ -346,6 +347,14 @@ gsize lua_logger_out_type (lua_State *L, gint pos, gchar *outbuf, void *rspamd_lua_check_udata (lua_State *L, gint pos, const gchar *classname); /** + * Safely checks userdata to match specified class + * @param L + * @param pos + * @param classname + */ +void *rspamd_lua_check_udata_maybe (lua_State *L, gint pos, const gchar *classname); + +/** * Call finishing script with the specified task * @param L * @param sc |