You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-dev@incubator.apache.org by "Rico Neubauer (JIRA)" <ji...@apache.org> on 2007/10/26 10:58:50 UTC

[jira] Updated: (FTPSERVER-112) Connection is closed by remote server without waiting for client

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

Rico Neubauer updated FTPSERVER-112:
------------------------------------

    Attachment: apache-ftpserver-112-patch.patch

> Connection is closed by remote server without waiting for client
> ----------------------------------------------------------------
>
>                 Key: FTPSERVER-112
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-112
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Core
>            Reporter: Rico Neubauer
>         Attachments: apache-ftpserver-112-patch.patch
>
>
> FTP-Server is using MinaListener as listener class and the corresponding MinaFtpResponseOutput to write the replies.
> When sending QUIT to the server, a reply "200 Goodbye." is send back and after that the connection is closed from the server. The problem here is that the reply is sent asynchronously and the connection is closed before this happen.
> MinaFtpResponseOutput#write:
> public void write(FtpReply response) throws IOException {
>     session.write(response);
> }
> where session is IoSession interface. The following is the javadoc for this method:
> Writes the specified message to remote peer. This operation is asynchronous;
> {@link IoHandler#messageSent(IoSession, Object)} will be invoked when the message is actually sent to remote peer. You can also wait for the returned {@link WriteFuture} if you want to wait for the message actually written.
> And in the end the Apache QUIT impl:
> session.resetState();
> out.write(FtpReplyUtil.translate(session,FtpReply.REPLY_221_CLOSING_CONTROL_CONNECTION, "QUIT", null));   
> connection.getServerContext().getConnectionManager().closeConnection(connection);
> Bottom line: Before actually the client receives the reply, the connection is
> closed. This is happening with certain FTP clients, e.g. FileZilla:
> Command:        PWD
> Response:       257 "/" is current directory.
> Status:         Directory listing successful
> Command:        quit
> Error:          Disconnected from server 

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