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

FTPHTTPClient should use socket factory to create sockets

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: FTP
    • Labels:
      None
    • Environment:

      win7 + java 64, apache-commons-net3.3.jar

      Description

      FTPHTTPClient can't set socket timeout when connecting to remote http proxy. This may cause hangouts for calls to remote http ftp proxies.

      Expected: FTPHTTPClient supports creation sockets with Factory methods. We had same approach for regular FTPClient calling .setSocketFactory(...) method and have control over socket creation.
      Actual: FTPHTTPClient creates Socket inside public void connect(...) directly, and it is impossible to set timouts since this object will be used immediately. It is even impossible to inherit from FTPHTTPClient to override connect - since proxyHost, proxyPort and tunnelHandshake is private.

      so we may change
      socket = new Socket(proxyHost, proxyPort);
      to
      socket = socketFactory.createSocket();

      and add support for FTPHTTPClient to handle socket factories for http proxies calls.

      Is it possiible?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Dzmitry_by Dzmitry
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: