lua: move output http funcs to generic util file

Move output Http functions to util-lua-http.c so that detect can use
it later.
pull/1112/head
Victor Julien 12 years ago
parent f23399d672
commit e0d544fb86

@ -228,7 +228,6 @@ output-json-ssh.c output-json-ssh.h \
output-json-tls.c output-json-tls.h \
output-lua.c output-lua.h \
output-lua-common.c output-lua-common.h \
output-lua-http.c output-lua-http.h \
output-packet.c output-packet.h \
output-streaming.c output-streaming.h \
output-tx.c output-tx.h \
@ -321,6 +320,7 @@ util-ip.h util-ip.c \
util-logopenfile.h util-logopenfile.c \
util-logopenfile-tile.h util-logopenfile-tile.c \
util-lua.c util-lua.h \
util-lua-http.c util-lua-http.h \
util-magic.c util-magic.h \
util-memcmp.c util-memcmp.h \
util-memcpy.h \

@ -55,7 +55,7 @@
#include "util-lua.h"
#include "output-lua-common.h"
#include "output-lua-http.h"
#include "util-lua-http.h"
#define MODULE_NAME "LuaLog"
@ -546,7 +546,7 @@ static lua_State *LuaScriptSetup(const char *filename)
LogLuaRegisterFunctions(luastate);
/* unconditionally register http function. They will only work
* if the tx is registered in the state at runtime though. */
LogLuaRegisterHttpFunctions(luastate);
LuaRegisterHttpFunctions(luastate);
if (lua_pcall(luastate, 0, 0, 0) != 0) {
SCLogError(SC_ERR_LUA_ERROR, "couldn't run script 'setup' function: %s", lua_tostring(luastate, -1));

@ -332,7 +332,7 @@ static int HttpGetResponseBody(lua_State *luastate)
}
/** \brief register http lua extensions in a luastate */
int LogLuaRegisterHttpFunctions(lua_State *luastate)
int LuaRegisterHttpFunctions(lua_State *luastate)
{
/* registration of the callbacks */
lua_pushcfunction(luastate, HttpGetRequestHeader);

@ -21,13 +21,13 @@
* \author Victor Julien <victor@inliniac.net>
*/
#ifndef __OUTPUT_LUA_HTTP_H__
#define __OUTPUT_LUA_HTTP_H__
#ifndef __UTIL_LUA_HTTP_H__
#define __UTIL_LUA_HTTP_H__
#ifdef HAVE_LUA
int LogLuaRegisterHttpFunctions(lua_State *luastate);
int LuaRegisterHttpFunctions(lua_State *luastate);
#endif /* HAVE_LUA */
#endif /* __OUTPUT_LUA_HTTP_H__ */
#endif /* __UTIL_LUA_HTTP_H__ */
Loading…
Cancel
Save