From 43cb8ed652aeb145dd968b7a6c5e853e24fc8f89 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 25 Jul 2017 23:13:23 -0300 Subject: [PATCH] Adds support to C section on auditlogs --- src/transaction.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/transaction.cc b/src/transaction.cc index 23ff3ecc..b040a978 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -1407,10 +1407,14 @@ std::string Transaction::toOldAuditLogFormat(int parts, } audit_log << std::endl; } - if (parts & audit_log::AuditLog::CAuditLogPart) { + if (parts & audit_log::AuditLog::CAuditLogPart + && m_requestBody.tellp() > 0) { + std::string body = m_requestBody.str(); audit_log << "--" << trailer << "-" << "C--" << std::endl; + if (body.size() > 0) { + audit_log << body << std::endl; + } audit_log << std::endl; - /** TODO: write audit_log C part. */ } if (parts & audit_log::AuditLog::DAuditLogPart) { audit_log << "--" << trailer << "-" << "D--" << std::endl;