commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Toshiaki Masaki (JIRA)" <j...@apache.org>
Subject [jira] Created: (NET-223) the data connection socket is not closed when an IOException occurred
Date Thu, 19 Jun 2008 08:35:46 GMT
the data connection socket is not closed when an IOException occurred
---------------------------------------------------------------------

                 Key: NET-223
                 URL: https://issues.apache.org/jira/browse/NET-223
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 1.4
         Environment: Windows
            Reporter: Toshiaki Masaki


In method FTPClient.initiateListParsing(FTPFileEntryParser, String), 
the data connection socket is not closed when an IOException(e.g. SocketTimeoutException)
occurred while calling FTPListParseEngine.readServerList().

> engine.readServerList(socket.getInputStream(), getControlEncoding());
> socket.close();

In other methods that open a data connection socket, like retrieveFile() and __storeFile(),
the socket is closed when an IOException occurred.

I think, the client should close the socket like the following.

> try {
>     engine.readServerList(socket.getInputStream(), getControlEncoding());
> } finally {
>     socket.close();

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


Mime
View raw message