[ 
https://issues.apache.org/jira/browse/FTPSERVER-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aniceto Pérez y Madrid updated FTPSERVER-369:
---------------------------------------------

    Description: 
I've created a simple program loop which open, connect and disconnect. If the 
max-logins parameter is set to 10, the message "Too many users logged in, user 
will be disconnected" is issued after 10 loops

The cause is in DefaultFtpStatistics. In this function
 
 public synchronized void setLogout(final FtpIoSession session) {
        User user = session.getUser();
        if (user == null) {
            return;
        }

        currLogins.decrementAndGet();

session.getUser() always returns null, so never currLogins.decrementAndGet() is 
called. My workaround is to put that statement before testing user null state. 

Why      session.getUser()  return null is out of my knowledge.
  

  was:
I've created a simple program loop which open, connect and disconnect. If the 
max-logins parameter is set to 10, the message "Too many users logged in, user 
will be disconnected" is issued.

The cause in the next code from DefaultFtpStatistics
 
 public synchronized void setLogout(final FtpIoSession session) {
        User user = session.getUser();
        if (user == null) {
            return;
        }

        currLogins.decrementAndGet();

session.getUser() always returns null, so never currLogins.decrementAndGet() is 
called. My workaround is to put that statement before testing user null state. 

Why      session.getUser()  return null is out of my knowledge.
  


> maxLogin is reached immediately 
> --------------------------------
>
>                 Key: FTPSERVER-369
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-369
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.4
>         Environment: Linux or Windows
>            Reporter: Aniceto Pérez y Madrid
>
> I've created a simple program loop which open, connect and disconnect. If the 
> max-logins parameter is set to 10, the message "Too many users logged in, 
> user will be disconnected" is issued after 10 loops
> The cause is in DefaultFtpStatistics. In this function
>  
>  public synchronized void setLogout(final FtpIoSession session) {
>         User user = session.getUser();
>         if (user == null) {
>             return;
>         }
>         currLogins.decrementAndGet();
> session.getUser() always returns null, so never currLogins.decrementAndGet() 
> is called. My workaround is to put that statement before testing user null 
> state. 
> Why      session.getUser()  return null is out of my knowledge.
>   

-- 
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