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


##########
src/proxy/http/HttpSM.cc:
##########
@@ -3136,7 +3136,8 @@ HttpSM::tunnel_handler(int event, void * /* data 
ATS_UNUSED */)
     return 0;
   }
 
-  ink_assert(event == HTTP_TUNNEL_EVENT_DONE || event == 
VC_EVENT_INACTIVITY_TIMEOUT);
+  ink_assert(event == HTTP_TUNNEL_EVENT_DONE || event == 
VC_EVENT_INACTIVITY_TIMEOUT || event == VC_EVENT_ACTIVE_TIMEOUT ||
+             event == VC_EVENT_ERROR || event == VC_EVENT_EOS);

Review Comment:
   This assertion is becoming a long chain of `||` conditions, which is harder 
to scan and extend safely. Consider rewriting it as a `switch (event)` with 
grouped `case` labels (or a small helper like `is_tunnel_handler_event(event)`) 
so the accepted event set is easier to read and modify.
   ```suggestion
     auto is_tunnel_handler_event = [](int ev) -> bool {
       switch (ev) {
       case HTTP_TUNNEL_EVENT_DONE:
       case VC_EVENT_INACTIVITY_TIMEOUT:
       case VC_EVENT_ACTIVE_TIMEOUT:
       case VC_EVENT_ERROR:
       case VC_EVENT_EOS:
         return true;
       default:
         return false;
       }
     };
   
     ink_assert(is_tunnel_handler_event(event));
   ```



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