bneradt commented on code in PR #13456:
URL: https://github.com/apache/trafficserver/pull/13456#discussion_r3909031665
##########
src/proxy/CacheControl.cc:
##########
@@ -254,6 +414,73 @@ CacheControlRecord::Init(matcher_line *line_info)
}
}
+ if (is_yaml_rule) {
+ int action_count = cache_responses_to_cookies >= 0 ? 1 : 0;
+
+ for (int i = 0; i < MATCHER_MAX_TOKENS && line_info->num_el; ++i) {
+ label = line_info->line[0][i];
+ val = line_info->line[1][i];
+ if (!label) {
+ continue;
+ }
+
+ bool used = true;
+ if (strcasecmp(label, "yaml_cache") == 0) {
+ if (strcasecmp(val, "never") == 0) {
+ yaml_cache_action = CacheControlType::NEVER_CACHE;
+ } else if (strcasecmp(val, "standard") == 0) {
+ yaml_cache_action = CacheControlType::STANDARD_CACHE;
+ } else {
+ return Result::failure("%s Invalid cache action at line %d in %s",
modulePrefix, line_num, ts::filename::CACHE);
+ }
Review Comment:
Addressed in `0196d33261`.
`ControlMatcher` now attaches its resolved `config_file_path` to each parsed
matcher line, and `CacheControlRecord::Init()` uses that active path in all of
its diagnostics. An explicitly selected legacy file therefore reports the
actual `cache.config` path instead of the `cache.yaml` default; direct
standalone construction retains the default fallback.
I also added a focused ControlMatcher assertion that an invalid legacy rule
reports `/etc/trafficserver/cache.config`.
Validation in `asfats5`:
- Format, unit-enabled incremental build, and install: passed.
- `test_proxy "[ControlMatcher]"`: 14 assertions in 3 test cases passed.
- Focused AuTests `cache-yaml` and `convert_cache`: 2/2 passed.
--
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]