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

Method toBeAdded

plugins/cachekey/configs.cc:156–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156bool
157ConfigElements::toBeAdded(const String &element) const
158{
159 /* Exclude the element if it is in the exclusion list. If the list is empty don't exclude anything. */
160 bool exclude = (!_exclude.empty() && _exclude.find(element) != _exclude.end()) ||
161 (!_excludePatterns.empty() && _excludePatterns.match(element));
162 CacheKeyDebug("%s '%s' %s the 'exclude' rule", name().c_str(), element.c_str(), exclude ? "matches" : "does not match");
163
164 /* Include the element only if it is in the inclusion list. If the list is empty include everything. */
165 bool include =
166 ((_include.empty() && _includePatterns.empty()) || _include.find(element) != _include.end()) || _includePatterns.match(element);
167 CacheKeyDebug("%s '%s' %s the 'include' rule", name().c_str(), element.c_str(), include ? "matches" : "do not match");
168
169 if (include && !exclude) {
170 CacheKeyDebug("%s '%s' should be added to cache key", name().c_str(), element.c_str());
171 return true;
172 }
173
174 CacheKeyDebug("%s '%s' should not be added to cache key", name().c_str(), element.c_str());
175 return false;
176}
177
178inline bool
179ConfigElements::noIncludeExcludeRules() const

Callers 3

getKeyQueryFunction · 0.80
captureWholeHeadersFunction · 0.80
appendCookiesMethod · 0.80

Calls 5

emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
matchMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected