zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvfangmin <...@git.apache.org>
Subject [GitHub] zookeeper pull request #548: [ZOOKEEPER-3057] Fix IPv6 literal usage
Date Tue, 26 Jun 2018 17:19:59 GMT
Github user lvfangmin commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/548#discussion_r198228805
  
    --- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
    @@ -225,17 +229,25 @@ static public InitialMessage parse(Long protocolVersion, DataInputStream
din)
                 // FIXME: IPv6 is not supported. Using something like Guava's HostAndPort
                 //        parser would be good.
                 String addr = new String(b);
    -            String[] host_port = addr.split(":");
    +            String[] host_port;
    +            try {
    +                host_port = ConfigUtils.splitServerConfig(addr);
    +            } catch (ConfigException e) {
    +                throw new InitialMessageException("Badly formed address: %s", addr);
    +            }
     
                 if (host_port.length != 2) {
                     throw new InitialMessageException("Badly formed address: %s", addr);
                 }
    +            //String[] host_port = addr.split(":");
    --- End diff --
    
    Remove this line.


---

Mime
View raw message