bryancall commented on code in PR #12619:
URL: https://github.com/apache/trafficserver/pull/12619#discussion_r2467162697
##########
plugins/experimental/maxmind_acl/mmdb.cc:
##########
@@ -399,19 +399,11 @@ Acl::parseregex(const YAML::Node ®ex, bool allow)
plugin_regex temp;
auto temprule = i.as<std::vector<std::string>>();
temp._regex_s = temprule.back();
- const char *error;
- int erroffset;
- temp._rex = pcre_compile(temp._regex_s.c_str(), 0, &error,
&erroffset, nullptr);
-
- // Compile the regex for this set of countries
- if (nullptr != temp._rex) {
- temp._extra = pcre_study(temp._rex, 0, &error);
- if ((nullptr == temp._extra) && error && (*error != 0)) {
- TSError("[%s] Failed to study regular expression in %s:%s",
PLUGIN_NAME, temp._regex_s.c_str(), error);
- return;
- }
- } else {
- TSError("[%s] Failed to compile regular expression in %s: %s",
PLUGIN_NAME, temp._regex_s.c_str(), error);
+ std::string error;
+ int erroroffset = 0;
+
+ if (!temp._rex.compile(temp._regex_s, error, erroroffset, 0)) {
Review Comment:
take off the flag and print out the error and the offset.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]