@@ -59,7 +59,7 @@ bool contains(const std::string &s, const std::string &pattern) {
5959
6060
6161void actions (ModSecurityTestResults<RegressionTest> *r,
62- modsecurity::Transaction *a) {
62+ modsecurity::Transaction *a, std::stringstream *serverLog ) {
6363 modsecurity::ModSecurityIntervention it;
6464 memset (&it, ' \0 ' , sizeof (modsecurity::ModSecurityIntervention));
6565 it.status = 200 ;
@@ -76,6 +76,7 @@ void actions(ModSecurityTestResults<RegressionTest> *r,
7676 it.url = NULL ;
7777 }
7878 if (it.log != NULL ) {
79+ *serverLog << it.log ;
7980 free (it.log );
8081 it.log = NULL ;
8182 }
@@ -273,7 +274,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
273274 modsec_transaction->processConnection (t->clientIp .c_str (),
274275 t->clientPort , t->serverIp .c_str (), t->serverPort );
275276
276- actions (&r, modsec_transaction);
277+ actions (&r, modsec_transaction, &serverLog );
277278#if 0
278279 if (r.status != 200) {
279280 goto end;
@@ -283,7 +284,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
283284 modsec_transaction->processURI (t->uri .c_str (), t->method .c_str (),
284285 t->httpVersion .c_str ());
285286
286- actions (&r, modsec_transaction);
287+ actions (&r, modsec_transaction, &serverLog );
287288#if 0
288289 if (r.status != 200) {
289290 goto end;
@@ -297,7 +298,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
297298 }
298299
299300 modsec_transaction->processRequestHeaders ();
300- actions (&r, modsec_transaction);
301+ actions (&r, modsec_transaction, &serverLog );
301302#if 0
302303 if (r.status != 200) {
303304 goto end;
@@ -308,7 +309,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
308309 (unsigned char *)t->request_body .c_str (),
309310 t->request_body .size ());
310311 modsec_transaction->processRequestBody ();
311- actions (&r, modsec_transaction);
312+ actions (&r, modsec_transaction, &serverLog );
312313#if 0
313314 if (r.status != 200) {
314315 goto end;
@@ -323,7 +324,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
323324
324325 modsec_transaction->processResponseHeaders (r.status ,
325326 t->response_protocol );
326- actions (&r, modsec_transaction);
327+ actions (&r, modsec_transaction, &serverLog );
327328#if 0
328329 if (r.status != 200) {
329330 goto end;
@@ -334,7 +335,7 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
334335 (unsigned char *)t->response_body .c_str (),
335336 t->response_body .size ());
336337 modsec_transaction->processResponseBody ();
337- actions (&r, modsec_transaction);
338+ actions (&r, modsec_transaction, &serverLog );
338339#if 0
339340 if (r.status != 200) {
340341 goto end;
0 commit comments