bneradt commented on code in PR #12505:
URL: https://github.com/apache/trafficserver/pull/12505#discussion_r2372719518
##########
plugins/compress/configuration.cc:
##########
@@ -190,6 +191,18 @@ HostConfiguration::is_status_code_compressible(const
TSHttpStatus status_code) c
return it != compressible_status_codes_.end();
}
+static std::string_view
+strip_params(std::string_view v)
+{
+ if (auto pos = v.find(';'); pos != std::string_view::npos) {
+ v = v.substr(0, pos);
+ }
+ // trim trailing spaces
+ while (!v.empty() && isspace(static_cast<unsigned char>(v.back())))
+ v.remove_suffix(1);
+ return v;
Review Comment:
Oh, the issue is `using namespace std;` at the top of the file. That
interferes with template deduction for `isspace` because there is both
`std::isspace` and `::isspace`. Can you try this instead (effectively,
`&::isspace`):
```patch
diff --git a/plugins/compress/configuration.cc
b/plugins/compress/configuration.cc
index 1f1ebf960..b93dee8b3 100644
--- a/plugins/compress/configuration.cc
+++ b/plugins/compress/configuration.cc
@@ -200,7 +200,7 @@ strip_params(std::string_view v)
{
swoc::TextView tv{v};
tv = tv.take_prefix_at(';');
- tv.rtrim_if([](int ch) { return std::isspace(ch); });
+ tv.rtrim_if(&::isspace);
return tv;
}
```
--
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]