Author: miguel
Date: 2007-12-03 03:18:01 -0500 (Mon, 03 Dec 2007)
New Revision: 90540

Modified:
   trunk/mcs/class/System/System.Net/ChangeLog
   trunk/mcs/class/System/System.Net/FtpWebRequest.cs
Log:
2007-12-03  Miguel de Icaza  <[EMAIL PROTECTED]>

        * FtpWebRequest.cs: Applied patch from Jerome Haltom that fixes
        multi-line responses (after my fix).

        Closes #333978



Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2007-12-03 05:02:21 UTC (rev 
90539)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2007-12-03 08:18:01 UTC (rev 
90540)
@@ -1,3 +1,10 @@
+2007-12-03  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * FtpWebRequest.cs: Applied patch from Jerome Haltom that fixes
+       multi-line responses (after my fix).
+
+       Closes #333978
+
 2007-11-16  Marek Habersack  <[EMAIL PROTECTED]>
 
        * HttpWebRequest.cs: when folding a request into a GET one, set

Modified: trunk/mcs/class/System/System.Net/FtpWebRequest.cs
===================================================================
--- trunk/mcs/class/System/System.Net/FtpWebRequest.cs  2007-12-03 05:02:21 UTC 
(rev 90539)
+++ trunk/mcs/class/System/System.Net/FtpWebRequest.cs  2007-12-03 08:18:01 UTC 
(rev 90540)
@@ -1006,22 +1006,18 @@
 
                                if (response [3] == '-'){
                                        string line = null;
+                                       string find = code.ToString() + ' ';
                                        while (true){
                                                try {
                                                        line = 
controlReader.ReadLine();
                                                } catch (IOException) {
                                                }
-                                               if (line == null || 
response.Length < 3)
+                                               if (line == null)
                                                        return 
ServiceNotAvailable ();
                                                
                                                response += Environment.NewLine 
+ line;
-                                               if (line.Length < 3)
-                                                       break;
 
-                                               if (!Int32.TryParse 
(line.Substring (0, 3), out fcode))
-                                                       return 
ServiceNotAvailable ();
-
-                                               if (code == fcode && line[3] == 
' ')
+                                               if (line.StartsWith(find, 
StringComparison.Ordinal))
                                                        break;
                                        } 
                                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to