bneradt commented on code in PR #12735:
URL: https://github.com/apache/trafficserver/pull/12735#discussion_r2600996257
##########
include/proxy/http/HttpConfig.h:
##########
@@ -852,6 +856,72 @@ struct HttpConfigParams : public ConfigInfo {
HttpConfigParams &operator=(const HttpConfigParams &) = delete;
};
+/////////////////////////////////////////////////////////////
+//
+// class ParsedConfigCache
+//
+/////////////////////////////////////////////////////////////
+
+/** Cache for pre-parsed string config values.
+ *
+ * Some overridable STRING configs require parsing (e.g., status code lists,
+ * host resolution preferences). Parsing can be non-trivial. This cache stores
+ * parsed results so repeated calls to TSHttpTxnConfigStringSet() with the same
+ * value don't re-parse.
+ *
+ * The static lookup() method handles everything: check cache, parse if needed,
+ * store in cache, and return the result.
+ */
+class ParsedConfigCache
+{
+public:
+ /** Pre-parsed representations for configs that need special parsing. */
+ struct ParsedValue {
Review Comment:
True. Sematically, std::variant is nice because it communicates explicitly
that only one is used at a time.
--
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]