Cosmetics: Using VariableValues instead of std::vector<...>

Making the code more readable.
This commit is contained in:
Felipe Zimmerle
2020-08-24 12:57:47 -03:00
committed by Felipe Zimmerle
parent d5cae10d3a
commit 64bffdebc4
54 changed files with 123 additions and 119 deletions

View File

@@ -961,7 +961,7 @@ int Transaction::processRequestBody() {
* computationally intensive.
*/
std::string fullRequest;
std::vector<std::shared_ptr<const VariableValue>> l;
VariableValues l;
m_variableRequestHeaders.resolve(&l);
for (const auto &h : l) {
fullRequest = fullRequest + h->getKey() + ": " + h->getValue() + "\n";
@@ -1490,7 +1490,7 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename,
ss << utils::string::dash_if_empty(this->m_clientIpAddress->c_str()) << " ";
/** TODO: Check variable */
variables::RemoteUser *r = new variables::RemoteUser("REMOTE_USER");
std::vector<std::shared_ptr<const VariableValue>> l;
VariableValues l;
r->evaluate(this, &l);
delete r;
@@ -1553,7 +1553,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
audit_log << std::endl;
if (parts & audit_log::AuditLog::BAuditLogPart) {
std::vector<std::shared_ptr<const VariableValue>> l;
VariableValues l;
audit_log << "--" << trailer << "-" << "B--" << std::endl;
audit_log << utils::string::dash_if_empty(
m_variableRequestMethod.evaluate());
@@ -1592,7 +1592,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
audit_log << std::endl;
}
if (parts & audit_log::AuditLog::FAuditLogPart) {
std::vector<std::shared_ptr<const VariableValue>> l;
VariableValues l;
audit_log << "--" << trailer << "-" << "F--" << std::endl;
audit_log << "HTTP/" << m_httpVersion.c_str() << " ";
@@ -1693,7 +1693,7 @@ std::string Transaction::toJSON(int parts) {
/* request headers */
if (parts & audit_log::AuditLog::BAuditLogPart) {
std::vector<std::shared_ptr<const VariableValue>> l;
VariableValues l;
yajl_gen_string(g, reinterpret_cast<const unsigned char*>("headers"),
strlen("headers"));
yajl_gen_map_open(g);
@@ -1722,7 +1722,7 @@ std::string Transaction::toJSON(int parts) {
/* response headers */
if (parts & audit_log::AuditLog::FAuditLogPart) {
std::vector<std::shared_ptr<const VariableValue>> l;
VariableValues l;
yajl_gen_string(g, reinterpret_cast<const unsigned char*>("headers"),
strlen("headers"));
yajl_gen_map_open(g);