incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r508750 - /incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/PasvTest.java
Date Sat, 17 Feb 2007 10:32:03 GMT
Author: ngn
Date: Sat Feb 17 02:32:03 2007
New Revision: 508750

URL: http://svn.apache.org/viewvc?view=rev&rev=508750
Log:
Ignoring 0.x.x.x IP numbers

Modified:
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/PasvTest.java

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/PasvTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/PasvTest.java?view=diff&rev=508750&r1=508749&r2=508750
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/PasvTest.java
(original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/PasvTest.java
Sat Feb 17 02:32:03 2007
@@ -44,20 +44,22 @@
             String ip = ips[i];
             String ftpIp = ip.replace('.', ',');
             
-            try{
-                client.connect(ip, port);
-            } catch(FTPConnectionClosedException e) {
-                // try again
-                Thread.sleep(200);
-                client.connect(ip, port);
+            if(!ip.startsWith("0.")) {
+                try{
+                    client.connect(ip, port);
+                } catch(FTPConnectionClosedException e) {
+                    // try again
+                    Thread.sleep(200);
+                    client.connect(ip, port);
+                }
+                client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
+                client.pasv();
+                
+                assertTrue(client.getReplyString().indexOf(ftpIp) > -1 );
+                
+                client.quit();
+                client.disconnect();
             }
-            client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
-            client.pasv();
-            
-            assertTrue(client.getReplyString().indexOf(ftpIp) > -1 );
-            
-            client.quit();
-            client.disconnect();
         }
     }
 }



Mime
View raw message