@@ -99,13 +99,9 @@ namespace modsecurity {
99
99
*
100
100
*/
101
101
Transaction::Transaction (ModSecurity *ms, Rules *rules, void *logCbData)
102
- : m_clientIpAddress(" " ),
103
- m_serverIpAddress (" " ),
104
- m_clientPort(0 ),
102
+ : m_clientPort(0 ),
105
103
m_serverPort (0 ),
106
- m_uri(" " ),
107
104
m_uri_no_query_string_decoded(" " ),
108
- m_httpVersion(" " ),
109
105
m_rules(rules),
110
106
m_timeStamp(std::time(NULL )),
111
107
m_httpCodeReturned(200 ),
@@ -1355,7 +1351,7 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename,
1355
1351
ss << utils::string::dash_if_empty (
1356
1352
m_variableRequestHeaders.resolveFirst (" Host" ).get ())
1357
1353
<< " " ;
1358
- ss << utils::string::dash_if_empty (this ->m_clientIpAddress ) << " " ;
1354
+ ss << utils::string::dash_if_empty (this ->m_clientIpAddress . c_str () ) << " " ;
1359
1355
/* * TODO: Check variable */
1360
1356
ss << utils::string::dash_if_empty (
1361
1357
m_collections.resolveFirst (" REMOTE_USER" ).get ());
@@ -1369,8 +1365,8 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename,
1369
1365
ss << " \" " ;
1370
1366
ss << utils::string::dash_if_empty (m_variableRequestMethod.evaluate ());
1371
1367
ss << " " ;
1372
- ss << this ->m_uri << " " ;
1373
- ss << " HTTP/" << m_httpVersion;
1368
+ ss << this ->m_uri . c_str () << " " ;
1369
+ ss << " HTTP/" << m_httpVersion. c_str () ;
1374
1370
ss << " \" " ;
1375
1371
1376
1372
ss << this ->m_httpCodeReturned << " " ;
@@ -1420,8 +1416,8 @@ std::string Transaction::toOldAuditLogFormat(int parts,
1420
1416
audit_log << " --" << trailer << " -" << " B--" << std::endl;
1421
1417
audit_log << utils::string::dash_if_empty (
1422
1418
m_variableRequestMethod.evaluate ());
1423
- audit_log << " " << this ->m_uri << " " << " HTTP/" ;
1424
- audit_log << this ->m_httpVersion << std::endl;
1419
+ audit_log << " " << this ->m_uri . c_str () << " " << " HTTP/" ;
1420
+ audit_log << this ->m_httpVersion . c_str () << std::endl;
1425
1421
1426
1422
m_variableRequestHeaders.resolve (&l);
1427
1423
for (auto &h : l) {
@@ -1459,7 +1455,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
1459
1455
std::vector<const collection::Variable *> l;
1460
1456
1461
1457
audit_log << " --" << trailer << " -" << " F--" << std::endl;
1462
- audit_log << " HTTP/" << m_httpVersion << " " << this ->m_httpCodeReturned << std::endl;
1458
+ audit_log << " HTTP/" << m_httpVersion. c_str () << " " << this ->m_httpCodeReturned << std::endl;
1463
1459
m_variableResponseHeaders.resolve (&l);
1464
1460
for (auto &h : l) {
1465
1461
size_t pos = strlen (" RESPONSE_HEADERS:" );
@@ -1528,11 +1524,11 @@ std::string Transaction::toJSON(int parts) {
1528
1524
1529
1525
yajl_gen_map_open (g);
1530
1526
/* Part: A (header mandatory) */
1531
- LOGFY_ADD (" client_ip" , this ->m_clientIpAddress );
1527
+ LOGFY_ADD (" client_ip" , this ->m_clientIpAddress . c_str () );
1532
1528
LOGFY_ADD (" time_stamp" , ts.c_str ());
1533
1529
LOGFY_ADD (" server_id" , uniqueId.c_str ());
1534
1530
LOGFY_ADD_NUM (" client_port" , m_clientPort);
1535
- LOGFY_ADD (" host_ip" , m_serverIpAddress);
1531
+ LOGFY_ADD (" host_ip" , m_serverIpAddress. c_str () );
1536
1532
LOGFY_ADD_NUM (" host_port" , m_serverPort);
1537
1533
LOGFY_ADD (" id" , this ->m_id .c_str ());
1538
1534
@@ -1545,8 +1541,8 @@ std::string Transaction::toJSON(int parts) {
1545
1541
utils::string::dash_if_empty (
1546
1542
m_variableRequestMethod.evaluate ()).c_str ());
1547
1543
1548
- LOGFY_ADD_INT (" http_version" , m_httpVersion);
1549
- LOGFY_ADD (" uri" , this ->m_uri );
1544
+ LOGFY_ADD_INT (" http_version" , m_httpVersion. c_str () );
1545
+ LOGFY_ADD (" uri" , this ->m_uri . c_str () );
1550
1546
1551
1547
if (parts & audit_log::AuditLog::CAuditLogPart) {
1552
1548
// FIXME: check for the binary content size.
0 commit comments