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.


---

Reply via email to