lgoldstein commented on a change in pull request #124:
URL: https://github.com/apache/mina-sshd/pull/124#discussion_r412252747



##########
File path: 
sshd-core/src/main/java/org/apache/sshd/client/keyverifier/KnownHostsServerKeyVerifier.java
##########
@@ -153,35 +153,43 @@ public void 
setModifiedServerKeyAcceptor(ModifiedServerKeyAcceptor acceptor) {
 
     @Override
     public boolean verifyServerKey(ClientSession clientSession, SocketAddress 
remoteAddress, PublicKey serverKey) {
-        Collection<HostEntryPair> knownHosts = getLoadedHostsEntries();
         try {
             if (checkReloadRequired()) {
                 Path file = getPath();
                 if (exists()) {
-                    knownHosts = reloadKnownHosts(clientSession, file);
+                    updateReloadAttributes();
+                    keysSupplier = 
GenericUtils.memoizeLock(getKnownHostSupplier(clientSession, file));
                 } else {
                     if (log.isDebugEnabled()) {
                         log.debug("verifyServerKey({})[{}] missing known hosts 
file {}",
                                 clientSession, remoteAddress, file);
                     }
-                    knownHosts = Collections.emptyList();
+                    keysSupplier = 
GenericUtils.memoizeLock(Collections::emptyList);

Review comment:
       Update of `keysSupplier` field is not mutually exclusive...




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to