You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/07/12 17:29:52 UTC
svn commit: r963321 -
/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
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;
}