funky-eyes commented on code in PR #7451:
URL: https://github.com/apache/incubator-seata/pull/7451#discussion_r2157276919
##########
core/src/main/java/org/apache/seata/core/protocol/detector/HttpDetector.java:
##########
@@ -52,10 +67,59 @@ private boolean startsWith(ByteBuf buffer, String prefix) {
@Override
public ChannelHandler[] getHandlers() {
+ HttpServerCodec sourceCodec = new HttpServerCodec();
+ HttpServerUpgradeHandler upgradeHandler =
getHttpServerUpgradeHandler(sourceCodec);
+
+ ChannelInboundHandlerAdapter upgradeCleanupHandler = new
ChannelInboundHandlerAdapter() {
+ @Override
+ public void userEventTriggered(ChannelHandlerContext ctx, Object
evt) throws Exception {
+ if (evt instanceof HttpServerUpgradeHandler.UpgradeEvent) {
+ ChannelPipeline p = ctx.pipeline();
+ p.remove(HttpObjectAggregator.class);
+ p.remove(HttpDispatchHandler.class);
+ }
+ super.userEventTriggered(ctx, evt);
+ }
+ };
+
+ ChannelInboundHandlerAdapter finalExceptionHandler = new
ChannelInboundHandlerAdapter() {
+ @Override
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable
cause) {
+ if (cause instanceof java.io.IOException) {
+ LOGGER.trace("Connection closed by client: {}",
cause.getMessage());
+ } else {
+ LOGGER.error("Exception caught in HTTP pipeline: ", cause);
+ }
+ ctx.close();
+ }
+ };
Review Comment:
`.\curl.exe -i -X POST 127.0.0.1:8091/health --http2`
```
23:23:16.110 ERROR --- [tyServerNIOWorker_1_10_16]
[protocol.detector.HttpDetector] [ exceptionCaught] [] : Connection closed
by client:
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]