Mina listener does not update session usage information
-------------------------------------------------------

                 Key: FTPSERVER-92
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-92
             Project: FtpServer
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.0-M2
            Reporter: Steve Jones


The Mina listener does not update the session last usage time on each request. 

This causes non-idle users to be disconnected if an idle timeout is set.

The IOConnection for the IO listener calls AbstractConnection#notifyObserver 
for each request processed, something similar should be done for the Mina 
listener. In the absence of any observers, the below change addresses the issue 
adequately.

Index: 
core/src/java/org/apache/ftpserver/listener/mina/MinaFtpProtocolHandler.java
===================================================================
--- 
core/src/java/org/apache/ftpserver/listener/mina/MinaFtpProtocolHandler.java    
    (revision 543677)
+++ 
core/src/java/org/apache/ftpserver/listener/mina/MinaFtpProtocolHandler.java    
    (working copy)
@@ -100,8 +100,10 @@
         MinaConnection connection = (MinaConnection) 
session.getAttribute(CONNECTION_KEY);
         MinaFtpResponseOutput output = (MinaFtpResponseOutput) 
session.getAttribute(OUTPUT_KEY);
 
+        FtpSessionImpl ftpSession = (FtpSessionImpl) connection.getSession();
+        ftpSession.updateLastAccessTime();
         
-        protocolHandler.onRequestReceived(connection, 
(FtpSessionImpl)connection.getSession(), output, request);
+        protocolHandler.onRequestReceived(connection, ftpSession, output, 
request);
     }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to