mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
perf. improvement/rx: Only compute dynamic regex in case of macro
On #1528 was added the support for macro expansion on @rx operator. The performance improvement suggested on the pull request was not thread safe, therefore removed. This patch adds a performance improvement on top of #1528. The benchmarks points to 10x faster results on OWASP CRS.
This commit is contained in:
@@ -1027,6 +1027,11 @@ op_before_init:
|
||||
| OPERATOR_RX FREE_TEXT
|
||||
{
|
||||
OPERATOR_CONTAINER($$, new operators::Rx($2));
|
||||
std::string error;
|
||||
if ($$->init(driver.ref.back(), &error) == false) {
|
||||
driver.error(@0, error);
|
||||
YYERROR;
|
||||
}
|
||||
}
|
||||
| OPERATOR_STR_EQ FREE_TEXT
|
||||
{
|
||||
|
Reference in New Issue
Block a user