2007-10-30 Jerome Haltom (wasabi@larvalstage.net)
authorMiguel de Icaza <miguel@gnome.org>
Tue, 30 Oct 2007 14:51:40 +0000 (14:51 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 30 Oct 2007 14:51:40 +0000 (14:51 -0000)
* FtpWebRequest.cs: adds support for ftp multiline results, fixes
#333978

svn path=/trunk/mcs/; revision=88460

mcs/class/System/System.Net/ChangeLog
mcs/class/System/System.Net/FtpWebRequest.cs

index 091e546c09080f9d047407844ec305ab9af5541f..d064f26835e1057ebbbed8a76c2c826314362644 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-30  Jerome Haltom  (wasabi@larvalstage.net)
+
+       * FtpWebRequest.cs: adds support for ftp multiline results, fixes
+       #333978
+
 2007-10-27  Miguel de Icaza  <miguel@novell.com>
 
        * HttpListener.cs: Remove more trigger-happy disposed=true from
index 44d21f670bce9afd48bc1ab04d07b2e0bcaf7702..4daee58a35fe364f1b49236f5277c2adbc894fbb 100644 (file)
@@ -1014,6 +1014,17 @@ namespace System.Net
 
                                if (responseString.Length < 4 || responseString [3] != '-')
                                        return new FtpStatus ((FtpStatusCode) code, responseString);
+
+                               if (responseString [3] == '-') {
+                                       string line = null;
+                                       do {
+                                               line = controlReader.ReadLine();
+                                               responseString += Environment.NewLine + line;
+                                       } while (line.Length < 3 || (line [3] != ' ' && line.Substring (0, 3) != codeString));
+                                       return new FtpStatus ((FtpStatusCode) code, responseString);
+                               }
+
+                               return new FtpStatus (FtpStatusCode.ServiceNotAvailable, "Invalid response from server");
                        }
                }