Copilot commented on code in PR #13262:
URL: https://github.com/apache/trafficserver/pull/13262#discussion_r3408311947


##########
src/tscore/Diags.cc:
##########
@@ -57,6 +57,11 @@ using namespace swoc::literals;
 void
 DiagsConfigState::enabled(DiagsTagType dtt, int new_value)
 {
+  // proxy.config.diags.debug.enabled is validated as [0-3] in 
RecordsConfig.cc.
+  // Value 3 is not range-checked here; it reaches _enabled[dtt] and
+  // DbgCtl::_config_mode unchanged.  In Diags::on(), the test
+  // (config.enabled(mode) & 1) makes value 3 behave identically to value 1
+  // (always-enabled).

Review Comment:
   The new comment is a bit misleading: only `proxy.config.diags.debug.enabled` 
is range-validated as `[0-3]` (action.enabled has no check), and `_config_mode` 
is updated here — it’s the *value* that is passed through unchanged (not 
normalized). Consider clarifying this to avoid implying that `_config_mode` 
isn’t updated or that validation applies to both modes.



-- 
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]

Reply via email to