Refactoring: Makes transformations to work with new execute signature

This commit is contained in:
Felipe Zimmerle
2019-02-26 15:39:27 -03:00
parent 44c63d1048
commit 68f85628dd
93 changed files with 913 additions and 715 deletions

View File

@@ -307,7 +307,9 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
while (!trans.empty()) {
modsecurity::actions::transformations::Transformation *t;
std::string varValueRes;
ModSecStackString in;
ModSecStackString out;
yajl_gen_map_open(g);
yajl_gen_string(g,
reinterpret_cast<const unsigned char*>("transformation"),
@@ -319,8 +321,9 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
t = modsecurity::actions::transformations::Transformation::instantiate(
trans.back().str().c_str());
varValueRes = t->execute(varValue, NULL);
varValue.assign(varValueRes);
in.assign(varValue.c_str());
t->execute(NULL, in, out);
varValue.assign(out.c_str());
trans.pop_back();
yajl_gen_string(g, reinterpret_cast<const unsigned char*>("value"),