bryancall commented on code in PR #12551:
URL: https://github.com/apache/trafficserver/pull/12551#discussion_r2414973640


##########
src/proxy/ControlMatcher.cc:
##########
@@ -476,13 +476,15 @@ RegexMatcher<Data, MatchResult>::Match(RequestData 
*rdata, MatchResult *result)
   // The function unescapifyStr() is already called in
   // HttpRequestData::get_string(); therefore, no need to call again here.
   for (int i = 0; i < num_el; i++) {
-    if (regex_array[i].exec(url_str) == true) {
+    RegexMatches matches;
+    int          r = regex_array[i].exec(url_str, matches);
+    if (r > 0) {
       Dbg(dbg_ctl_matcher, "%s Matched %s with regex at line %d", 
matcher_name, url_str, data_array[i].line_num);
       data_array[i].UpdateMatch(result, rdata);
-    } else {
+    } else if (r < 0 && r != PCRE2_ERROR_NOMATCH) {

Review Comment:
   You can do `} else if (r < -1) {`.   That was in the code before the Regex 
convertion.  I should have listen to my gut when converting this over to use 
the `bool` interface.  I thought there might be an issue, but I didn't want to 
create a matches object.



-- 
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]

Reply via email to