ShadowySpirits commented on code in PR #5029:
URL: https://github.com/apache/rocketmq/pull/5029#discussion_r966640210
##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java:
##########
@@ -45,6 +46,14 @@ public Object decode(ChannelHandlerContext ctx, ByteBuf in)
throws Exception {
}
return RemotingCommand.decode(frame);
} catch (Exception e) {
+ in.resetReaderIndex();
+ // user input may be HiRMQ, HiRMQ\n or HiRMQ\r\n
+ if (in.readableBytes() >= 5 || in.readableBytes() <= 7) {
+ String magicCode = in.readCharSequence(5,
StandardCharsets.UTF_8).toString();
+ if (magicCode.equalsIgnoreCase("HiRMQ")) {
Review Comment:
Good idea, I have added this feature to document.
--
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]