Skip to content

Commit 1f68075

Browse files
author
Felipe Zimmerle
committed
Process the logging phase on the benchmark utility
1 parent 1e3cafb commit 1f68075

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

test/benchmark/benchmark.cc

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,12 @@ int main(int argc, char *argv[]) {
9393

9494
if (modsecTransaction->intervention(&it)) {
9595
std::cout << "There is an intervention" << std::endl;
96-
delete modsecTransaction;
97-
continue;
96+
goto next_request;
9897
}
9998
modsecTransaction->processURI(request_uri, "GET", "1.1");
10099
if (modsecTransaction->intervention(&it)) {
101100
std::cout << "There is an intervention" << std::endl;
102-
delete modsecTransaction;
103-
continue;
101+
goto next_request;
104102
}
105103

106104
modsecTransaction->addRequestHeader("Host",
@@ -131,17 +129,15 @@ int main(int argc, char *argv[]) {
131129

132130
if (modsecTransaction->intervention(&it)) {
133131
std::cout << "There is an intervention" << std::endl;
134-
delete modsecTransaction;
135-
continue;
132+
goto next_request;
136133
}
137134

138135

139136
modsecTransaction->processRequestBody();
140137

141138
if (modsecTransaction->intervention(&it)) {
142139
std::cout << "There is an intervention" << std::endl;
143-
delete modsecTransaction;
144-
continue;
140+
goto next_request;
145141
}
146142

147143
modsecTransaction->addResponseHeader("HTTP/1.1",
@@ -155,8 +151,7 @@ int main(int argc, char *argv[]) {
155151

156152
if (modsecTransaction->intervention(&it)) {
157153
std::cout << "There is an intervention" << std::endl;
158-
delete modsecTransaction;
159-
continue;
154+
goto next_request;
160155
}
161156

162157

@@ -166,10 +161,11 @@ int main(int argc, char *argv[]) {
166161

167162
if (modsecTransaction->intervention(&it)) {
168163
std::cout << "There is an intervention" << std::endl;
169-
delete modsecTransaction;
170-
continue;
164+
goto next_request;
171165
}
172166

167+
next_request:
168+
modsecTransaction->processLogging(200);
173169
delete modsecTransaction;
174170
}
175171

0 commit comments

Comments
 (0)