incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r581378 - in /incubator/ftpserver/trunk/core/src: java/org/apache/ftpserver/command/ test/org/apache/ftpserver/clienttests/ test/org/apache/ftpserver/ftplet/
Date Tue, 02 Oct 2007 20:49:48 GMT
Author: ngn
Date: Tue Oct  2 13:49:47 2007
New Revision: 581378

URL: http://svn.apache.org/viewvc?rev=581378&view=rev
Log:
Fixing issue with STOU returning an incorrect reponse code (FTPSERVER-108)

Modified:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDefaultTest.java
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDisconnectTest.java

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java?rev=581378&r1=581377&r2=581378&view=diff
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java Tue Oct
 2 13:49:47 2007
@@ -23,6 +23,7 @@
 import java.io.OutputStream;
 import java.net.SocketException;
 
+import org.apache.ftpserver.DefaultFtpReply;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.FileObject;
 import org.apache.ftpserver.ftplet.FileSystemView;
@@ -47,8 +48,8 @@
  *
  * This command behaves like STOR except that the resultant
  * file is to be created in the current directory under a name
- * unique to that directory.  The 250 Transfer Started response
- * must include the name generated.
+ * unique to that directory.  The 150 Transfer Started response
+ * must include the name generated, See RFC1123 section 4.1.2.9
  */
 public 
 class STOU extends AbstractCommand {
@@ -125,12 +126,11 @@
             }
             
             // get data connection
-            out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_150_FILE_STATUS_OKAY,
"STOU", null));
-            
+            out.write(new DefaultFtpReply(FtpReply.REPLY_150_FILE_STATUS_OKAY, "FILE: " +
fileName));
+
             // get data from client
             boolean failure = false;
             OutputStream os = null;
-            out.write(FtpReplyUtil.translate(session, FtpReply.REPLY_250_REQUESTED_FILE_ACTION_OKAY,
"STOU", fileName));
             
             DataConnection dataConnection;
             try {

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java?rev=581378&r1=581377&r2=581378&view=diff
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java
(original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java
Tue Oct  2 13:49:47 2007
@@ -187,8 +187,6 @@
      * @throws Exception
      */
     private void doAssertOfUniqueFile(FTPClient client, File dir) throws Exception {
-        assertTrue(client.completePendingCommand());
-        
         String reply = client.getReplyString();
         String generatedFileName = reply.substring(5, reply.indexOf(':'));
         File testFile = new File(dir, generatedFileName);

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDefaultTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDefaultTest.java?rev=581378&r1=581377&r2=581378&view=diff
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDefaultTest.java
(original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDefaultTest.java
Tue Oct  2 13:49:47 2007
@@ -149,7 +149,6 @@
     public void testUploadUnique() throws Exception {
         client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
         client.storeUniqueFile(new ByteArrayInputStream(TESTDATA));
-        client.completePendingCommand();
         
         TestUtil.assertFileEqual(TESTDATA, ROOT_DIR.listFiles()[0]);
     }

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDisconnectTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDisconnectTest.java?rev=581378&r1=581377&r2=581378&view=diff
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDisconnectTest.java
(original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/ftplet/FtpLetReturnDisconnectTest.java
Tue Oct  2 13:49:47 2007
@@ -452,7 +452,6 @@
         
         client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
         assertTrue(client.storeUniqueFile(new ByteArrayInputStream(TESTDATA)));
-        assertTrue(client.completePendingCommand());
         try {
             client.noop();
             fail("Must throw FTPConnectionClosedException");



Mime
View raw message