brbzull0 commented on code in PR #12917:
URL: https://github.com/apache/trafficserver/pull/12917#discussion_r2904624086
##########
include/records/RecCore.h:
##########
@@ -69,9 +71,32 @@ std::string RecConfigReadConfigPath(const char
*file_variable, const char *defau
// Return a copy of the persistent stats file. This is
$RUNTIMEDIR/records.snap.
std::string RecConfigReadPersistentStatsPath();
-// Test whether the named configuration value is overridden by an environment
variable. Return either
-// the overridden value, or the original value. Caller MUST NOT free the
result.
-const char *RecConfigOverrideFromEnvironment(const char *name, const char
*value);
+/// Indicates why RecConfigOverrideFromEnvironment() chose its returned value.
+enum class RecConfigOverrideSource {
+ NONE, ///< No override — the original value was kept.
+ ENV, ///< Overridden by a PROXY_CONFIG_* environment variable.
+ RUNROOT, ///< Overridden with the resolved Layout path because runroot
manages this record.
+};
+
+/// Human-readable label for the override source (for logging).
+constexpr const char *
+RecConfigOverrideSourceName(RecConfigOverrideSource src)
+{
+ switch (src) {
+ case RecConfigOverrideSource::ENV:
+ return "environment variable";
+ case RecConfigOverrideSource::RUNROOT:
+ return "runroot";
+ default:
+ return "none";
Review Comment:
yes, means the rec wasn't overriden.
can't put an assert, this is constexpr.
added a `NONE` case now. For code completeness added a default with `unknown`
--
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]