While working through the code looking to add hooks for signaling the monitoring events, I noticed the following bit of code in the ResponseFuture:

           //Authenticate
           int authCount = request.getAuthCount() + 1;
           if (authCount <= 3) {
               request.setAuthCount(authCount);
               client.sendRequest(request);

// if we've been provided with a cache, put this session into
               // the cache.
               SessionCache cache = getSessionCache();
               if (cache != null) {
                   // cache the session before we return
                   cache.cacheSession(ioSession);
               }
               return;
           }


This is sending the challenge response back to the server, but returning the connection to the cache AFTER the request is sent back. Shouldn't the connection be returned to the cache BEFORE the challenge response is sent to allow the connection to be reused?

Rick

Reply via email to