zwoop commented on code in PR #12679:
URL: https://github.com/apache/trafficserver/pull/12679#discussion_r2784117703
##########
src/proxy/http/HttpConfig.cc:
##########
@@ -694,6 +694,40 @@ const MgmtConverter HttpStatusCodeList::Conv{
}};
// clang-format on
+/////////////////////////////////////////////////////////////
+//
+// TargetedCacheControlHeaders implementation
+//
+/////////////////////////////////////////////////////////////
+
+void
+TargetedCacheControlHeaders::parse(std::string_view src)
+{
+ count = 0;
+ swoc::TextView config_view{src};
+
+ while (config_view && count < MAX_HEADERS) {
Review Comment:
What happens if the config has more than MAX_HEADERS? Silent ignored it
seems? Should we throw a warning at least (seems like that would indicate a
configuration error).
##########
include/proxy/http/HttpConfig.h:
##########
@@ -92,6 +92,44 @@ class HttpStatusCodeList
HttpStatusBitset _data;
};
+/**
+ * Pre-parsed list of targeted cache control header names (RFC 9213).
+ *
+ * Instead of parsing a comma-separated string on each request, this class
+ * stores the header names as an array of string_views into a stable backing
+ * string. The Converter ensures the string is parsed once at config load time
+ * and whenever the per-transaction override is set.
+ */
+class TargetedCacheControlHeaders
+{
+public:
+ static const MgmtConverter Conv;
Review Comment:
I know we don't do this consistently, but if the copy constructor /
assignment constructor shouldn't be used (seems iffy with the raw pointer),
should we = delete; them here ?
--
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]