Oliverwqcwrw commented on code in PR #5029:
URL: https://github.com/apache/rocketmq/pull/5029#discussion_r966552753
##########
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:
I think that it was important to let the user know that the response was
sent by `hirmq`, so It needs to be marked on the 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]