This is an automated email from the ASF dual-hosted git repository.
lizhanhui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new dd4ebd0a9 [ISSUE #5291] Optimize the NettyRemotingServer. (#5299)
dd4ebd0a9 is described below
commit dd4ebd0a9099484536b5080320d81a2f70d10944
Author: echooymxq <[email protected]>
AuthorDate: Fri Oct 14 13:10:23 2022 +0800
[ISSUE #5291] Optimize the NettyRemotingServer. (#5299)
---
.../org/apache/rocketmq/remoting/netty/NettyRemotingServer.java | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java
index 5af8c7621..39be96c52 100644
---
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java
+++
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java
@@ -452,10 +452,7 @@ public class NettyRemotingServer extends
NettyRemotingAbstract implements Remoti
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {
- // mark the current position so that we can peek the first byte to
determine if the content is starting with
- // TLS handshake
- msg.markReaderIndex();
-
+ // Peek the first byte to determine if the content is starting
with TLS handshake
byte b = msg.getByte(0);
if (b == HANDSHAKE_MAGIC_CODE) {
@@ -486,9 +483,6 @@ public class NettyRemotingServer extends
NettyRemotingAbstract implements Remoti
log.warn("Clients intend to establish an insecure connection
while this server is running in SSL enforcing mode");
}
- // reset the reader index so that handshake negotiation may
proceed as normal.
- msg.resetReaderIndex();
-
try {
// Remove this handler
ctx.pipeline().remove(this);