mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-21 03:26:42 +03:00
Makes Lua::run const
This commit is contained in:
@@ -121,7 +121,7 @@ const char *Lua::blob_reader(lua_State *L, void *ud, size_t *size) {
|
||||
#endif
|
||||
|
||||
|
||||
int Lua::run(Transaction *t, const std::string &str) {
|
||||
int Lua::run(Transaction *t, const std::string &str) const {
|
||||
#ifdef WITH_LUA
|
||||
std::string luaRet;
|
||||
const char *a = NULL;
|
||||
@@ -138,10 +138,12 @@ int Lua::run(Transaction *t, const std::string &str) {
|
||||
luaL_setfuncs(L, mscLuaLib, 0);
|
||||
lua_setglobal(L, "m");
|
||||
|
||||
LuaScriptBlob blob(m_blob);
|
||||
|
||||
#ifdef WITH_LUA_5_1
|
||||
int rc = lua_load(L, Lua::blob_reader, &m_blob, m_scriptName.c_str());
|
||||
int rc = lua_load(L, Lua::blob_reader, &blob, m_scriptName.c_str());
|
||||
#else
|
||||
int rc = lua_load(L, Lua::blob_reader, &m_blob, m_scriptName.c_str(),
|
||||
int rc = lua_load(L, Lua::blob_reader, &blob, m_scriptName.c_str(),
|
||||
NULL);
|
||||
#endif
|
||||
if (rc != LUA_OK) {
|
||||
|
||||
Reference in New Issue
Block a user