MCPcopy Create free account
hub / github.com/apache/trafficserver / matchAll

Method matchAll

plugins/experimental/access_control/pattern.cc:547–561  ·  view source on GitHub ↗

* @brief Matches a subject string by matching against the vector of named multi-patterns * in the order they were added and returns the first non-matching multi-pattern name. * @param subject string subject being classified. * @param name reference to a string where the name of the class that matched first will be stored. * @param pattern last checked pattern from the multi-pattern that did no

Source from the content-addressed store, hash-verified

545 * @return true if all multi-patterns matched, false otherwise.
546 */
547bool
548Classifier::matchAll(const String &subject, String &name, String &pattern) const
549{
550 bool matched = true;
551 for (auto p : _list) {
552 if (p->empty()) {
553 continue;
554 } else if (!p->match(subject, pattern)) {
555 name = p->name();
556 matched = false;
557 break;
558 }
559 }
560 return matched;
561}
562
563/**
564 * @brief Adds a multi-pattern to the classifier.

Callers 1

TSRemapDoRemapFunction · 0.80

Calls 3

emptyMethod · 0.45
matchMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected