2007-02-16 Geoff Norton <gnorton@customerdna.com>
[mono.git] / mcs / class / System / System.Net / VMWHttpProvider.jvm.cs
index 689ba3aa307989894b1254160e2e93e5348f0086..b65b198fb346e89d76e215f1bac83636f6af5115 100644 (file)
@@ -352,10 +352,10 @@ namespace System.Net
                        }\r
 \r
                        if (this.CookieContainer != null) \r
-                       {
-                               string cookieHeader = this.CookieContainer.GetCookieHeader (this.GetOriginalAddress());
-                               if (cookieHeader != "")
-                                       _method.setRequestHeader("Cookie", cookieHeader);
+                       {\r
+                               string cookieHeader = this.CookieContainer.GetCookieHeader (this.GetOriginalAddress());\r
+                               if (cookieHeader != "")\r
+                                       _method.setRequestHeader("Cookie", cookieHeader);\r
                        }\r
                        SetConnectionHeader(Headers["Connection"]);\r
                        \r
@@ -592,18 +592,18 @@ namespace System.Net
                        {\r
                                if(_asyncWrite != null)\r
                                {\r
-                                       throw new InvalidOperationException ("Cannot re-call start of asynchronous " +
-                                               "method while a previous call is still in progress.");
-                               }
-       
-                               _asyncWrite = new GHWebAsyncResult (this, callback, state);
-                               if (_hasRequest) 
-                               {
-                                       if (_writeStream != null) 
-                                       {
-                                               _asyncWrite.SetCompleted (true, _writeStream);
-                                               _asyncWrite.DoCallback ();
-                                               return _asyncWrite;
+                                       throw new InvalidOperationException ("Cannot re-call start of asynchronous " +\r
+                                               "method while a previous call is still in progress.");\r
+                               }\r
+       \r
+                               _asyncWrite = new GHWebAsyncResult (this, callback, state);\r
+                               if (_hasRequest) \r
+                               {\r
+                                       if (_writeStream != null) \r
+                                       {\r
+                                               _asyncWrite.SetCompleted (true, _writeStream);\r
+                                               _asyncWrite.DoCallback ();\r
+                                               return _asyncWrite;\r
                                        }\r
                                }\r
                                \r
@@ -617,8 +617,8 @@ namespace System.Net
                                        _asyncWrite.SetCompleted(false, e);\r
                                }\r
 \r
-                               _asyncWrite.SetCompleted (true, _writeStream);
-                               _asyncWrite.DoCallback ();
+                               _asyncWrite.SetCompleted (true, _writeStream);\r
+                               _asyncWrite.DoCallback ();\r
                                return _asyncWrite;\r
                                \r
                        }\r
@@ -626,22 +626,22 @@ namespace System.Net
 \r
                public override Stream EndGetRequestStream(IAsyncResult asyncResult)\r
                {\r
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
-
-                       GHWebAsyncResult result = asyncResult as GHWebAsyncResult;
-                       if (result == null)
-                               throw new ArgumentException ("Invalid IAsyncResult");
-
-                       _asyncWrite = result;
-
-                       result.WaitUntilComplete ();
-
-                       Exception e = result.Exception;
-                       
-                       if (e != null)
-                               throw e;
-
+                       if (asyncResult == null)\r
+                               throw new ArgumentNullException ("asyncResult");\r
+\r
+                       GHWebAsyncResult result = asyncResult as GHWebAsyncResult;\r
+                       if (result == null)\r
+                               throw new ArgumentException ("Invalid IAsyncResult");\r
+\r
+                       _asyncWrite = result;\r
+\r
+                       result.WaitUntilComplete ();\r
+\r
+                       Exception e = result.Exception;\r
+                       \r
+                       if (e != null)\r
+                               throw e;\r
+\r
                        return result.WriteStream;\r
                }\r
 \r
@@ -651,18 +651,18 @@ namespace System.Net
                        {\r
                                if(_asyncRead != null && !_hasResponse)\r
                                {\r
-                                       throw new InvalidOperationException ("Cannot re-call start of asynchronous " +
-                                               "method while a previous call is still in progress.");
-                               }
-       
-                               _asyncRead = new GHWebAsyncResult (this, callback, state);
-                               if (_hasResponse) 
-                               {
-                                       if (_response != null) 
-                                       {
-                                               _asyncRead.SetCompleted (true, _writeStream);
-                                               _asyncRead.DoCallback ();
-                                               return _asyncRead;
+                                       throw new InvalidOperationException ("Cannot re-call start of asynchronous " +\r
+                                               "method while a previous call is still in progress.");\r
+                               }\r
+       \r
+                               _asyncRead = new GHWebAsyncResult (this, callback, state);\r
+                               if (_hasResponse) \r
+                               {\r
+                                       if (_response != null) \r
+                                       {\r
+                                               _asyncRead.SetCompleted (true, _writeStream);\r
+                                               _asyncRead.DoCallback ();\r
+                                               return _asyncRead;\r
                                        }\r
                                }\r
                                \r
@@ -674,9 +674,9 @@ namespace System.Net
                                catch(Exception e)\r
                                {\r
                                        _asyncRead.SetCompleted(false, e);\r
-                               }
-                               _asyncRead.SetCompleted (true, _writeStream);
-                               _asyncRead.DoCallback ();       
+                               }\r
+                               _asyncRead.SetCompleted (true, _writeStream);\r
+                               _asyncRead.DoCallback ();       \r
                                return _asyncRead;\r
                                \r
                        }\r
@@ -684,21 +684,21 @@ namespace System.Net
 \r
                public override WebResponse EndGetResponse(IAsyncResult asyncResult)\r
                {\r
-                       if (asyncResult == null)
-                               throw new ArgumentNullException ("asyncResult");
-
-                       GHWebAsyncResult result = asyncResult as GHWebAsyncResult;
-                       if (result == null)
-                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
-
-                       
-                       _asyncRead = result;
+                       if (asyncResult == null)\r
+                               throw new ArgumentNullException ("asyncResult");\r
+\r
+                       GHWebAsyncResult result = asyncResult as GHWebAsyncResult;\r
+                       if (result == null)\r
+                               throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");\r
+\r
+                       \r
+                       _asyncRead = result;\r
                        if (!result.WaitUntilComplete (_timeout, false)) \r
-                       {
-                               Abort ();
-                               throw new WebException("The request timed out", WebExceptionStatus.Timeout);
-                       }
-                       
+                       {\r
+                               Abort ();\r
+                               throw new WebException("The request timed out", WebExceptionStatus.Timeout);\r
+                       }\r
+                       \r
                        return result.Response;\r
                }\r
 \r
@@ -891,20 +891,20 @@ namespace System.Net
                        }\r
 \r
                        public WaitHandle AsyncWaitHandle \r
-                       {
+                       {\r
                                get \r
-                               {
+                               {\r
                                        if (_handle == null) \r
-                                       {
+                                       {\r
                                                lock (this) \r
-                                               {
-                                                       if (_handle == null)
-                                                               _handle = new ManualResetEvent (_isCompleted);
-                                               }
-                                       }
-                               
-                                       return _handle;
-                               }
+                                               {\r
+                                                       if (_handle == null)\r
+                                                               _handle = new ManualResetEvent (_isCompleted);\r
+                                               }\r
+                                       }\r
+                               \r
+                                       return _handle;\r
+                               }\r
                        }\r
 \r
                        public bool IsCompleted\r
@@ -964,9 +964,9 @@ namespace System.Net
                        internal void DoCallback()\r
                        {\r
                                if (!_callbackDone && _callback != null) \r
-                               {
-                                       _callbackDone = true;
-                                       _callback (this);
+                               {\r
+                                       _callbackDone = true;\r
+                                       _callback (this);\r
                                }\r
                        }\r
 \r
@@ -977,12 +977,12 @@ namespace System.Net
                                AsyncWaitHandle.WaitOne ();\r
                        }\r
 \r
-                       internal bool WaitUntilComplete (int timeout, bool exitContext)
-                       {
-                               if (_isCompleted)
-                                       return true;
-
-                               return AsyncWaitHandle.WaitOne (timeout, exitContext);
+                       internal bool WaitUntilComplete (int timeout, bool exitContext)\r
+                       {\r
+                               if (_isCompleted)\r
+                                       return true;\r
+\r
+                               return AsyncWaitHandle.WaitOne (timeout, exitContext);\r
                        }\r
                        #endregion\r
 \r