Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-223

the data connection socket is not closed when an IOException occurred

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows

      Description

      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();

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              t-masaki Toshiaki Masaki
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: