commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r963321 - /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
Date Mon, 12 Jul 2010 15:29:52 GMT
Author: sebb
Date: Mon Jul 12 15:29:52 2010
New Revision: 963321

URL: http://svn.apache.org/viewvc?rev=963321&view=rev
Log:
NET-313 - Allow activeMaxPort == activeMinPort in getActivePort() method

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=963321&r1=963320&r2=963321&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
Mon Jul 12 15:29:52 2010
@@ -1013,8 +1013,10 @@ implements Configurable
      */
     private int getActivePort()
     {
-        if (__activeMinPort > 0 && __activeMaxPort > __activeMinPort)
+        if (__activeMinPort > 0 && __activeMaxPort >= __activeMinPort)
         {
+            if (__activeMaxPort == __activeMinPort)
+                return __activeMaxPort;
             // Get a random port between the min and max port range
             return __random.nextInt(__activeMaxPort - __activeMinPort + 1) + __activeMinPort;
         }



Mime
View raw message