@@ -59,7 +59,7 @@ bool contains(const std::string &s, const std::string &pattern) {
59
59
60
60
61
61
void actions (ModSecurityTestResults<RegressionTest> *r,
62
- modsecurity::Transaction *a) {
62
+ modsecurity::Transaction *a, std::stringstream *serverLog ) {
63
63
modsecurity::ModSecurityIntervention it;
64
64
memset (&it, ' \0 ' , sizeof (modsecurity::ModSecurityIntervention));
65
65
it.status = 200 ;
@@ -76,6 +76,7 @@ void actions(ModSecurityTestResults<RegressionTest> *r,
76
76
it.url = NULL ;
77
77
}
78
78
if (it.log != NULL ) {
79
+ *serverLog << it.log ;
79
80
free (it.log );
80
81
it.log = NULL ;
81
82
}
@@ -273,7 +274,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
273
274
modsec_transaction->processConnection (t->clientIp .c_str (),
274
275
t->clientPort , t->serverIp .c_str (), t->serverPort );
275
276
276
- actions (&r, modsec_transaction);
277
+ actions (&r, modsec_transaction, &serverLog );
277
278
#if 0
278
279
if (r.status != 200) {
279
280
goto end;
@@ -283,7 +284,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
283
284
modsec_transaction->processURI (t->uri .c_str (), t->method .c_str (),
284
285
t->httpVersion .c_str ());
285
286
286
- actions (&r, modsec_transaction);
287
+ actions (&r, modsec_transaction, &serverLog );
287
288
#if 0
288
289
if (r.status != 200) {
289
290
goto end;
@@ -297,7 +298,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
297
298
}
298
299
299
300
modsec_transaction->processRequestHeaders ();
300
- actions (&r, modsec_transaction);
301
+ actions (&r, modsec_transaction, &serverLog );
301
302
#if 0
302
303
if (r.status != 200) {
303
304
goto end;
@@ -308,7 +309,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
308
309
(unsigned char *)t->request_body .c_str (),
309
310
t->request_body .size ());
310
311
modsec_transaction->processRequestBody ();
311
- actions (&r, modsec_transaction);
312
+ actions (&r, modsec_transaction, &serverLog );
312
313
#if 0
313
314
if (r.status != 200) {
314
315
goto end;
@@ -323,7 +324,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
323
324
324
325
modsec_transaction->processResponseHeaders (r.status ,
325
326
t->response_protocol );
326
- actions (&r, modsec_transaction);
327
+ actions (&r, modsec_transaction, &serverLog );
327
328
#if 0
328
329
if (r.status != 200) {
329
330
goto end;
@@ -334,7 +335,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
334
335
(unsigned char *)t->response_body .c_str (),
335
336
t->response_body .size ());
336
337
modsec_transaction->processResponseBody ();
337
- actions (&r, modsec_transaction);
338
+ actions (&r, modsec_transaction, &serverLog );
338
339
#if 0
339
340
if (r.status != 200) {
340
341
goto end;
0 commit comments