This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 472e61f YAML config: output erroneous keyword and line number in
YAML file it appears on in diags.log.
472e61f is described below
commit 472e61f92c07827a34e1a11c87fcc2058871901f
Author: Walter Karas <[email protected]>
AuthorDate: Tue Oct 1 16:24:25 2019 -0500
YAML config: output erroneous keyword and line number in YAML file it
appears on in diags.log.
(cherry picked from commit 823baa89bd37bcdc7916550208bc3f9272db4334)
---
iocore/net/YamlSNIConfig.cc | 6 +++---
proxy/logging/YamlLogConfig.cc | 2 +-
proxy/logging/YamlLogConfigDecoders.cc | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/iocore/net/YamlSNIConfig.cc b/iocore/net/YamlSNIConfig.cc
index 4a7cefa..a9abe8e 100644
--- a/iocore/net/YamlSNIConfig.cc
+++ b/iocore/net/YamlSNIConfig.cc
@@ -117,10 +117,10 @@ template <> struct convert<YamlSNIConfig::Item> {
static bool
decode(const Node &node, YamlSNIConfig::Item &item)
{
- for (auto &&item : node) {
+ for (const auto &elem : node) {
if (std::none_of(valid_sni_config_keys.begin(),
valid_sni_config_keys.end(),
- [&item](const std::string &s) { return s ==
item.first.as<std::string>(); })) {
- throw YAML::ParserException(item.Mark(), "unsupported key " +
item.first.as<std::string>());
+ [&elem](const std::string &s) { return s ==
elem.first.as<std::string>(); })) {
+ throw YAML::ParserException(elem.first.Mark(), "unsupported key " +
elem.first.as<std::string>());
}
}
diff --git a/proxy/logging/YamlLogConfig.cc b/proxy/logging/YamlLogConfig.cc
index 398bfcb..985f0aa 100644
--- a/proxy/logging/YamlLogConfig.cc
+++ b/proxy/logging/YamlLogConfig.cc
@@ -119,7 +119,7 @@ YamlLogConfig::decodeLogObject(const YAML::Node &node)
for (auto const &item : node) {
if (std::none_of(valid_log_object_keys.begin(),
valid_log_object_keys.end(),
[&item](const std::string &s) { return s ==
item.first.as<std::string>(); })) {
- throw YAML::ParserException(item.Mark(), "log: unsupported key '" +
item.first.as<std::string>() + "'");
+ throw YAML::ParserException(item.first.Mark(), "log: unsupported key '"
+ item.first.as<std::string>() + "'");
}
}
diff --git a/proxy/logging/YamlLogConfigDecoders.cc
b/proxy/logging/YamlLogConfigDecoders.cc
index 5726445..fca2817 100644
--- a/proxy/logging/YamlLogConfigDecoders.cc
+++ b/proxy/logging/YamlLogConfigDecoders.cc
@@ -36,10 +36,10 @@ namespace YAML
bool
convert<std::unique_ptr<LogFormat>>::decode(const Node &node,
std::unique_ptr<LogFormat> &logFormat)
{
- for (auto &&item : node) {
+ for (const auto &item : node) {
if (std::none_of(valid_log_format_keys.begin(),
valid_log_format_keys.end(),
[&item](const std::string &s) { return s ==
item.first.as<std::string>(); })) {
- throw YAML::ParserException(node.Mark(), "format: unsupported key '" +
item.first.as<std::string>() + "'");
+ throw YAML::ParserException(item.first.Mark(), "format: unsupported key
'" + item.first.as<std::string>() + "'");
}
}