Skip to content

Commit 686e953

Browse files
committed
clang fixes
1 parent 327f8fa commit 686e953

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

src/proxy/http/remap/RemapYamlConfig.cc

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ remap_validate_yaml_filter_args(acl_filter_rule **rule_pp, const YAML::Node &nod
197197
return swoc::Errata("filters must be a map");
198198
}
199199

200-
bool action_flag = false;
201-
202200
// Parse method
203201
auto parse_method = [&](const std::string &method_str) {
204202
int m = hdrtoken_tokenize(method_str.c_str(), method_str.length(), nullptr) - HTTP_WKSIDX_CONNECT;
@@ -408,15 +406,6 @@ remap_validate_yaml_filter_args(acl_filter_rule **rule_pp, const YAML::Node &nod
408406

409407
// Parse action
410408
if (node["action"]) {
411-
if (action_flag) {
412-
Dbg(dbg_ctl_url_rewrite, "Only one action: is allowed per remap ACL");
413-
if (new_rule_flg) {
414-
delete rule;
415-
*rule_pp = nullptr;
416-
}
417-
return swoc::Errata("Only one action is allowed per remap ACL");
418-
}
419-
action_flag = true;
420409
std::string action_str = node["action"].as<std::string>();
421410
if (behavior_policy == ACLBehaviorPolicy::ACL_BEHAVIOR_MODERN) {
422411
// With the new matching policy, we don't allow the legacy "allow" and
@@ -652,9 +641,9 @@ parse_yaml_define_directive(const YAML::Node &node, BUILD_TABLE_INFO *bti)
652641

653642
// When iterating over a YAML map, each element is a key-value pair
654643
// We expect a single-entry map here
655-
auto it = node.begin();
656-
std::string filter_name = it->first.as<std::string>();
657-
const YAML::Node &filter_spec = it->second;
644+
auto it = node.begin();
645+
std::string filter_name = it->first.as<std::string>();
646+
const YAML::Node filter_spec = it->second;
658647

659648
flg = ((rp = acl_filter_rule::find_byname(bti->rules_list, filter_name.c_str())) == nullptr) ? true : false;
660649
// coverity[alloc_arg]
@@ -1030,7 +1019,8 @@ parse_yaml_remap_rule(const YAML::Node &node, BUILD_TABLE_INFO *bti)
10301019
if (node["plugins"] && (maptype == mapping_type::FORWARD_MAP || maptype == mapping_type::FORWARD_MAP_REFERER ||
10311020
maptype == mapping_type::FORWARD_MAP_WITH_RECV_PORT)) {
10321021
if (!node["plugins"] || !node["plugins"].IsSequence()) {
1033-
return swoc::Errata("plugins must be a sequence");
1022+
errStr = "plugins must be a sequence";
1023+
goto MAP_ERROR;
10341024
}
10351025

10361026
for (const auto &plugin : node["plugins"]) {
@@ -1048,7 +1038,7 @@ parse_yaml_remap_rule(const YAML::Node &node, BUILD_TABLE_INFO *bti)
10481038
goto MAP_ERROR;
10491039
}
10501040

1051-
fromHost_lower_ptr = static_cast<char *>(ats_free_null(fromHost_lower_ptr));
1041+
ats_free_null(fromHost_lower_ptr);
10521042

10531043
Dbg(dbg_ctl_remap_yaml, "Successfully added mapping rule");
10541044
return {};

0 commit comments

Comments
 (0)