aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_http.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-25 13:17:21 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-25 13:17:21 +0100
commitc2765b3eb3c3beb3d9f42dc061761df2e300904c (patch)
tree0f5924f4fd821b16a258465d9dcb0068e5332bf2 /src/lua/lua_http.c
parenta1be94b4c4b59de216e0b8b721a951b2325f7215 (diff)
downloadrspamd-c2765b3eb3c3beb3d9f42dc061761df2e300904c.tar.gz
rspamd-c2765b3eb3c3beb3d9f42dc061761df2e300904c.zip
Use modules preload for lua.
Diffstat (limited to 'src/lua/lua_http.c')
-rw-r--r--src/lua/lua_http.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c
index d1a4434c2..8803df80c 100644
--- a/src/lua/lua_http.c
+++ b/src/lua/lua_http.c
@@ -355,11 +355,17 @@ lua_http_request (lua_State *L)
return 1;
}
-gint
-luaopen_http (lua_State * L)
+static gint
+lua_load_http (lua_State * L)
{
-
- luaL_register (L, "rspamd_http", httplib_m);
+ lua_newtable (L);
+ luaL_register (L, NULL, httplib_m);
return 1;
}
+
+void
+luaopen_http (lua_State * L)
+{
+ rspamd_lua_add_preload (L, "rspamd_http", lua_load_http);
+}