You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/07/11 16:53:09 UTC

[GitHub] [zookeeper] eolivelli commented on a change in pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in sq…

eolivelli commented on a change in pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398#discussion_r453213174



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java
##########
@@ -70,16 +69,22 @@ public ConnectStringParser(String connectString) {
         List<String> hostsList = split(connectString, ",");
         for (String host : hostsList) {
             int port = DEFAULT_PORT;
-            try {
-                String[] hostAndPort = ConfigUtils.getHostAndPort(host);
+            String[] hostAndPort = NetUtils.getIPV6HostAndPort(host);
+            if (hostAndPort.length != 0) {
                 host = hostAndPort[0];
                 if (hostAndPort.length == 2) {
                     port = Integer.parseInt(hostAndPort[1]);
                 }
-            } catch (ConfigException e) {
-                e.printStackTrace();
+            } else {

Review comment:
       Why this part of the logic is not inside 
   NetUtils.getIPV6HostAndPort(host) ?
   What about pushing it up there?




----------------------------------------------------------------
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.

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