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 2013/12/06 21:40:56 UTC

svn commit: r1548716 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPClient.java

Author: sebb
Date: Fri Dec  6 20:40:56 2013
New Revision: 1548716

URL: http://svn.apache.org/r1548716
Log:
NET-518 FTPClient#initFeatureMap should not initialize empty map if reply code is 530

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.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=1548716&r1=1548715&r2=1548716&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Fri Dec  6 20:40:56 2013
@@ -64,6 +64,10 @@ The <action> type attribute can be add,u
     <body>
         <release version="3.4" date="2013-??-??" description="
         ">
+            <action issue="NET-518" dev="sebb" type="fix" due-to="David Kocher">
+            FTPClient#initFeatureMap should not initialize empty map if reply code is 530
+            </action>
+        </release>
             <action issue="NET-514" dev="sebb" type="fix">
             IMAP APPEND multiple issues in IMapClient.
             Deprecated unusable append methods.

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1548716&r1=1548715&r2=1548716&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Fri Dec  6 20:40:56 2013
@@ -2322,7 +2322,11 @@ implements Configurable
     private boolean initFeatureMap() throws IOException {
         if (__featuresMap == null) {
             // Don't create map here, because next line may throw exception
-            boolean success = FTPReply.isPositiveCompletion(feat());
+            final int replyCode = feat();
+            if (replyCode == FTPReply.NOT_LOGGED_IN) { // 503
+                return false; // NET-518; don't create empy map
+            }
+            boolean success = FTPReply.isPositiveCompletion(replyCode);
             // we init the map here, so we don't keep trying if we know the command will fail
             __featuresMap = new HashMap<String, Set<String>>();
             if (!success) {