gemmellr commented on code in PR #5908:
URL: https://github.com/apache/activemq-artemis/pull/5908#discussion_r2330860243


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java:
##########
@@ -184,7 +208,9 @@ public void channelRead(ChannelHandlerContext ctx, Object 
msg) throws Exception
                ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, 
FORBIDDEN)).addListener(ChannelFutureListener.CLOSE);
             }
          } else {
-            super.channelRead(ctx, msg);
+            // slice off the proxy-related bytes that have already been read 
so other protocol handlers don't choke on them
+            super.channelRead(ctx, skipProxyBytes ? ((ByteBuf) msg).slice() : 
msg);
+            skipProxyBytes = false;

Review Comment:
   Yep I got that, I just wondered if there was some way to do that buffer 
handling closer to the HAProxyMessage servicing, or maybe even inspect the 
status of the decoder that produces it and so avoid the ProtocolHandler having 
to consider it on every subsequent execution given it should never arise again. 
Similarly with the other comment that it would be nice to avoid the instanceof, 
especially when proxyProtocol support isnt even enabled.



-- 
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]
For further information, visit: https://activemq.apache.org/contact


Reply via email to