You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by hanm <gi...@git.apache.org> on 2018/07/27 03:58:26 UTC

[GitHub] zookeeper pull request #545: ZOOKEEPER-2261 When only secureClientPort is co...

Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/545#discussion_r205662651
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java ---
    @@ -866,6 +866,9 @@ public void setServerCnxnFactory(ServerCnxnFactory factory) {
         }
     
         public ServerCnxnFactory getServerCnxnFactory() {
    +        if (secureServerCnxnFactory != null) {
    +            return secureServerCnxnFactory;
    +        }
             return serverCnxnFactory;
         }
     
    --- End diff --
    
    Would it be better to, instead of mix `secureServerCnxnFactory` in `getServerCnxnFactory`, add a separate method `getSecureServerCnxnFactory`? This also maps well with existing set method `setSecureServerCnxnFactory`. Caller now has to explicitly call both, which is more work, but makes semantics more clear. 


---