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


##########
src/proxy/http3/Http3App.cc:
##########
@@ -286,6 +303,10 @@ Http3App::_handle_uni_stream_on_read_ready(int /* event 
*/, VIO *vio)
   default:
     break;
   }
+
+  if (error && error->cls != Http3ErrorClass::UNDEFINED) {
+    this->_handle_error(*error);
+  }

Review Comment:
   Stream-class errors are currently passed through this new error-handling 
block, but `_handle_error()` only handles `Http3ErrorClass::CONNECTION`. For 
`Http3ErrorClass::STREAM` (e.g., unknown unidirectional stream types), this 
leaves the unread data buffered and unconsumed on repeated READ_READY events, 
which can grow memory usage and does not satisfy the spec requirement to abort 
reading or discard the stream data.



##########
src/proxy/http3/Http3ProtocolEnforcer.cc:
##########
@@ -30,7 +30,7 @@ Http3ProtocolEnforcer::interests()
   return {Http3FrameType::DATA,         Http3FrameType::HEADERS,      
Http3FrameType::X_RESERVED_1, Http3FrameType::CANCEL_PUSH,
           Http3FrameType::SETTINGS,     Http3FrameType::PUSH_PROMISE, 
Http3FrameType::X_RESERVED_2, Http3FrameType::GOAWAY,
           Http3FrameType::X_RESERVED_3, Http3FrameType::X_RESERVED_4, 
Http3FrameType::MAX_PUSH_ID,  Http3FrameType::X_MAX_DEFINED,
-          Http3FrameType::UNKNOWN};
+          Http3FrameType::RESERVED,     Http3FrameType::UNKNOWN};

Review Comment:
   `Http3ProtocolEnforcer::interests()` includes both 
`Http3FrameType::MAX_PUSH_ID` and `Http3FrameType::X_MAX_DEFINED`, but these 
enum values share the same underlying value (0x0D). Because 
`Http3FrameDispatcher::add_handler()` registers handlers by 
`static_cast<uint8_t>(t)`, this will register the same handler twice for frame 
type 0x0D and cause `handle_frame()` to run twice for a single MAX_PUSH_ID 
frame.



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