* FtpWebRequest.cs: Remove WebExceptionStatus argument
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Thu, 9 Feb 2006 06:27:17 +0000 (06:27 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Thu, 9 Feb 2006 06:27:17 +0000 (06:27 -0000)
from CreateExceptionFromResponse, since exceptions gotten
from server response always have a WebExceptionStatus.ProtocolError
value.

2006-02-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>

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

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

index ac6f141af53ddb609d5ef1ea949440e5c80cb7fd..cad61b215e238f7df6c39d63c0d59682bab27ac4 100644 (file)
@@ -1,3 +1,10 @@
+2006-02-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * FtpWebRequest.cs: Remove WebExceptionStatus argument
+       from CreateExceptionFromResponse, since exceptions gotten
+       from server response always have a WebExceptionStatus.ProtocolError
+       value.
+       
 2006-02-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * FtpWebRequest.cs: Add renaming support when using 
index d930e073faf49fa9a02ba080d5ade32062ff1137..276e0c31b3aa6e0eaa1c5a197a83921aa402f8aa 100644 (file)
@@ -295,7 +295,7 @@ namespace System.Net
                {
                        FtpStatusCode status = SendCommand (AbortCommand);
                        if (status != FtpStatusCode.ClosingData)
-                               throw CreateExceptionFromResponse (0); // Probably ignore it by now
+                               throw CreateExceptionFromResponse (); // Probably ignore it by now
 
                        aborted = true;
                        if (asyncRead != null) {
@@ -362,7 +362,7 @@ namespace System.Net
                void ProcessSimpleRequest ()
                {
                        if (SendCommand (method, requestUri.LocalPath) != FtpStatusCode.PathnameCreated) {
-                               asyncRead.SetCompleted (true, CreateExceptionFromResponse (0));
+                               asyncRead.SetCompleted (true, CreateExceptionFromResponse ());
                                return;
                        }
 
@@ -375,7 +375,7 @@ namespace System.Net
                {
                        FtpStatusCode status = SendCommand (method, requestUri.LocalPath);
                        if (status != FtpStatusCode.FileStatus) {
-                               asyncRead.SetCompleted (true, CreateExceptionFromResponse (0));
+                               asyncRead.SetCompleted (true, CreateExceptionFromResponse ());
                                return;
                        }
 
@@ -426,14 +426,14 @@ namespace System.Net
                        }
 
                        ftpResponse.UpdateStatus (statusCode, statusDescription);
-                       asyncRead.SetCompleted (true, CreateExceptionFromResponse (0));
+                       asyncRead.SetCompleted (true, CreateExceptionFromResponse ());
                }
 
                void UploadData ()
                {
                        if (gotRequestStream) {
                                if (GetResponseCode () != FtpStatusCode.ClosingData)
-                                       asyncRead.SetCompleted (true, CreateExceptionFromResponse (0));
+                                       asyncRead.SetCompleted (true, CreateExceptionFromResponse ());
                                
                                return;
                        }
@@ -454,7 +454,7 @@ namespace System.Net
                        if (offset > 0) {
                                status = SendCommand (RestCommand, offset.ToString ());
                                if (status != FtpStatusCode.FileCommandPending) {
-                                       asyncRead.SetCompleted (true, CreateExceptionFromResponse (0));
+                                       asyncRead.SetCompleted (true, CreateExceptionFromResponse ());
                                        return;
                                }
                        }
@@ -594,7 +594,7 @@ namespace System.Net
                        controlReader = new StreamReader (controlStream, Encoding.ASCII);
 
                        if (!Authenticate ()) {
-                               SetResponseError (CreateExceptionFromResponse (0));
+                               SetResponseError (CreateExceptionFromResponse ());
                                return false;
                        }
 
@@ -659,10 +659,10 @@ namespace System.Net
                        return sock;
                }
 
-               Exception CreateExceptionFromResponse (WebExceptionStatus status)
+               Exception CreateExceptionFromResponse ()
                {
-                       WebException exc = new WebException ("Server returned an error: " + statusDescription, null, status,
-                                       ftpResponse);
+                       WebException exc = new WebException ("Server returned an error: " + statusDescription, null, 
+                                       WebExceptionStatus.ProtocolError, ftpResponse);
                        return exc;
                }
                
@@ -696,7 +696,7 @@ namespace System.Net
                        if (usePassive) {
                                status = SendCommand (PassiveCommand);
                                if (status != FtpStatusCode.EnteringPassive) {
-                                       SetResponseError (CreateExceptionFromResponse (0));
+                                       SetResponseError (CreateExceptionFromResponse ());
                                        return null;
                                }
                                
@@ -730,7 +730,7 @@ namespace System.Net
                        if (status != FtpStatusCode.CommandOK) {
                                sock.Close ();
                                
-                               SetResponseError (CreateExceptionFromResponse (0));
+                               SetResponseError (CreateExceptionFromResponse ());
                                return null;
                        }
 
@@ -749,14 +749,14 @@ namespace System.Net
                                status = SendCommand (TypeCommand, DataType);
                                
                                if (status != FtpStatusCode.CommandOK) {
-                                       SetResponseError (CreateExceptionFromResponse (0));
+                                       SetResponseError (CreateExceptionFromResponse ());
                                        return false;
                                }
                        }
 
                        status = SendCommand (method, requestUri.LocalPath);
                        if (status != FtpStatusCode.OpeningData) {
-                               SetResponseError (CreateExceptionFromResponse (0));
+                               SetResponseError (CreateExceptionFromResponse ());
                                return false;
                        }