Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8678598B6 for ; Sat, 18 Aug 2012 01:18:41 +0000 (UTC) Received: (qmail 56445 invoked by uid 500); 18 Aug 2012 01:18:40 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 56373 invoked by uid 500); 18 Aug 2012 01:18:40 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 56365 invoked by uid 99); 18 Aug 2012 01:18:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Aug 2012 01:18:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Aug 2012 01:18:37 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 63AEF23888E3 for ; Sat, 18 Aug 2012 01:17:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1374495 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPSClient.java Date: Sat, 18 Aug 2012 01:17:53 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120818011753.63AEF23888E3@eris.apache.org> Author: sebb Date: Sat Aug 18 01:17:52 2012 New Revision: 1374495 URL: http://svn.apache.org/viewvc?rev=1374495&view=rev Log: NET-426 FTPS: Hook to customize _openDataConnection_ SSLSocket before startHandshake() is called Properly interface with FTPClient.openDataConnection(String, String) Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1374495&r1=1374494&r2=1374495&view=diff ============================================================================== --- commons/proper/net/trunk/src/changes/changes.xml (original) +++ commons/proper/net/trunk/src/changes/changes.xml Sat Aug 18 01:17:52 2012 @@ -65,6 +65,11 @@ The type attribute can be add,u + + FTPS: Hook to customize _openDataConnection_ SSLSocket before startHandshake() is called. + Implement _openDataConnection(String, String) method to properly + interface with FTPClient.openDataConnection(String, String) + TelnetClient hangs when reader-thread startup is delayed. Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java?rev=1374495&r1=1374494&r2=1374495&view=diff ============================================================================== --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java Sat Aug 18 01:17:52 2012 @@ -572,6 +572,26 @@ public class FTPSClient extends FTPClien @Override protected Socket _openDataConnection_(int command, String arg) throws IOException { + return _openDataConnection_(FTPCommand.getCommand(command), arg); + } + + /** + * Returns a socket of the data connection. + * Wrapped as an {@link SSLSocket}, which carries out handshake processing. + * @param command The textual representation of the FTP command to send. + * @param arg The arguments to the FTP command. + * If this parameter is set to null, then the command is sent with + * no arguments. + * @return corresponding to the established data connection. + * Null is returned if an FTP protocol error is reported at any point + * during the establishment and initialization of the connection. + * @throws IOException If there is any problem with the connection. + * @see FTPClient#_openDataConnection_(int, String) + * @since 3.2 + */ + @Override + protected Socket _openDataConnection_(String command, String arg) + throws IOException { Socket socket = super._openDataConnection_(command, arg); _prepareDataSocket_(socket); if (socket instanceof SSLSocket) {