RongtongJin commented on code in PR #7823:
URL: https://github.com/apache/rocketmq/pull/7823#discussion_r1479114741


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java:
##########
@@ -351,9 +351,10 @@ public void initChannel(SocketChannel ch) {
         return bootstrap;
     }
 
-    // Do not use RemotingUtil, it will directly resolve the domain
+    // Do not use RemotingHelper.string2SocketAddress(), it will directly 
resolve the domain
     private String[] getHostAndPort(String address) {
-        return address.split(":");
+        int split = address.lastIndexOf(":");
+        return split < 0 ? new String[]{address} : new 
String[]{address.substring(0, split), address.substring(split + 1)};
     }

Review Comment:
   It would be better to add an UT.



-- 
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: commits-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to