masaori335 opened a new pull request, #12284: URL: https://github.com/apache/trafficserver/pull/12284
Alternative approach of #12206 to override HTTP Status Code list in the config. PR #12206 has a overhead because the per-remap configuration list was stored as a string and parsed on every transactions. This PR avoids that cost by **parsing the string once at config-load time** by introducing new TS APIs. # New TS APIs Proposal ```c++ TS_RECORDDATATYPE_VARIANT using TSConfigValue = std::variant<int64_t, float, char *, HttpStatusCodeList *>; TSReturnCode TSHttpTxnConfigParse(TSConfigValue &dst, TSOverridableConfigKey key, const char *value, size_t length); TSReturnCode TSHttpTxnConfigSet(TSHttpTxn txnp, TSOverridableConfigKey key, const TSConfigValue &src); ``` `TSHttpTxnConfigParse` parses given string into appropriate data structure and stores it in a `TSConfigValue`. It's a variant of data structures. `TSHttpTxnConfigSet` set the parsed `TSConfigValue` to the transaction to override a variable. `TSConfigValue` is a `std::variant` for type safety and future extension. # Usage The changes in `conf_remap` illustrate how to use the new APIs. 1. (Re)loading config: Parse the config string into `HttpStatusCodeList *` by `TSHttpTxnConfigParse` and store it in the `TSConfigValue` 2. Remap: Override the variable by `TSHttpTxnConfigSet` # Out of scope The `HttpStatusBitSet` container could be replaced by `std::unordered_set` or similar to reduce memory usage, but that refactoring is intentionally left for a future PR. -- 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: github-unsubscr...@trafficserver.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org