]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-lua: register common callbacks
authorVictor Julien <victor@inliniac.net>
Thu, 20 Feb 2014 16:55:15 +0000 (17:55 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 15 Aug 2014 11:58:25 +0000 (13:58 +0200)
Clean up callback registration in the setup-stage and register
common callbacks.

src/output-lua.c

index 97cebb2c7ecbc0fc9303cd0a0e590ea6e2606e47..18ebdff64f955813230244964d4fd04ab826d546 100644 (file)
@@ -431,10 +431,11 @@ static lua_State *LuaScriptSetup(const char *filename)
     }
     //LuaPrintStack(luastate);
 
-    if (1) { //http
-        if (LogLuaRegisterHttpFunctions(luastate) != 0)
-            SCLogInfo("boooh!");
-    }
+    /* register functions common to all */
+    LogLuaRegisterFunctions(luastate);
+    /* unconditionally register http function. They will only work
+     * if the tx is registered in the state at runtime though. */
+    LogLuaRegisterHttpFunctions(luastate);
 
     SCLogDebug("lua_State %p is set up", luastate);
     return luastate;