Merge pull request #3028 from lateralusX/jlorenss/threadpool_warning
[mono.git] / mcs / class / referencesource / System / net / System / Net / _Connection.cs
index 7b32af35d87226030b90492b09d5a2e77c9d202d..d52fcbca150143bf0aef3994bb16809b66d9ebdb 100644 (file)
@@ -17,12 +17,14 @@ namespace System.Net {
     using System.Net.Configuration;
     using System.Diagnostics.CodeAnalysis;
 
+#if !MONO
     internal enum ReadState {
         Start,
         StatusLine, // about to parse status line
         Headers,    // reading headers
         Data        // now read data
     }
+#endif
 
     internal enum DataParseStatus {
         NeedMoreData = 0,   // need more data
@@ -64,7 +66,7 @@ namespace System.Net {
         public WebParseErrorCode     Code;
     }
 
-
+#if !MONO
     struct TunnelStateObject {
         internal TunnelStateObject(HttpWebRequest r, Connection c){
             Connection = c;
@@ -702,7 +704,7 @@ namespace System.Net {
             if (startRequestResult != TriState.Unspecified) {
                 CompleteStartRequest(true, request, startRequestResult);
             }
-            // On Sync, we wait for the Connection to be come availble here,
+            // On [....], we wait for the Connection to be come availble here,
             if (!request.Async)
             {
                 object responseObject = request.ConnectionAsyncResult.InternalWaitForCompletion();
@@ -912,7 +914,7 @@ namespace System.Net {
 
             //
             // From now on the request.SetRequestSubmitDone must be called or it may hang
-            // For a sync request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
+            // For a [....] request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
             if (request.Async)
                 request.OpenWriteSideResponseWindow();
 
@@ -1078,7 +1080,7 @@ namespace System.Net {
             WebExceptionStatus ws = WebExceptionStatus.ConnectFailure;
             //
             // From now on the request.SetRequestSubmitDone must be called or it may hang
-            // For a sync request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
+            // For a [....] request the write side reponse windowwas opened in HttpWebRequest.SubmitRequest
             if (request.Async)
                 request.OpenWriteSideResponseWindow();
 
@@ -1372,7 +1374,7 @@ namespace System.Net {
                                     if (nextRequest != null )
                                     {
                                         // We cannot have HeadersCompleted on the request that was not placed yet on the write list
-                                        if(nextRequest.HeadersCompleted) // 
+                                        if(nextRequest.HeadersCompleted) // TODO: change to be Assert but only when stress got stable-stable
                                             throw new InternalException();
 
                                         // This codepath doesn't handle the case where the server has closed the
@@ -2124,7 +2126,7 @@ quit:
                 //    IIS6 does not close the connection on 403 so all subsequent requests will fail to be authorized on THAT connection.
                 //-----------------------------------------------------------------------------------------------
                 //5/15/2006
-                //Microsoft
+                //[....]
                 //The DTS Issue 595216 claims that we are unnecessarily closing the
                 //connection on 403 - even if it is a non SSL request. It seems
                 //that the original intention is to close the request for SSL requests
@@ -2153,7 +2155,7 @@ quit:
                 else
                 {
                     //QFE: 4599.
-                    //Author: Microsoft
+                    //Author: [....]
                     //in v2.0, in case of SSL Requests through proxy that require NTLM authentication,
                     //we are not honoring the Proxy-Connection: Keep-Alive header and
                     //closing the connection.
@@ -2928,7 +2930,7 @@ quit:
                         {
                             if (m_Error == WebExceptionStatus.Success)
                             {
-                                throw new InternalException();              // 
+                                throw new InternalException();              // TODO: replace it with a generic error for the product bits
                                 //m_Error = WebExceptionStatus.UnknownError;
                             }
 
@@ -3163,7 +3165,7 @@ quit:
             }
         }
         //
-        //    Peforms a Sync Read and calls the ReadComplete to process the result
+        //    Peforms a [....] Read and calls the ReadComplete to process the result
         //    The reads are done iteratively, until the Request has received enough
         //    data to contruct a response, or a 100-Continue is read, allowing the HttpWebRequest
         //    to return a write stream
@@ -3272,7 +3274,7 @@ quit:
 
             if (probeRead)
             {
-                // Sync 100-Continue wait only
+                // [....] 100-Continue wait only
                 request.FinishContinueWait();
                 if (pollSuccess)
                 {
@@ -3468,7 +3470,7 @@ quit:
             }
             //
             // Any exception is processed by HandleError() and ----ed to avoid throwing on a thread pool
-            // In the sync case the HandleError() will abort the request so the caller will pick up the result.
+            // In the [....] case the HandleError() will abort the request so the caller will pick up the result.
             //
             catch (Exception exception) {
                 if (NclUtilities.IsFatal(exception)) throw;
@@ -3846,4 +3848,5 @@ done:
         }
 #endif
     }
+#endif
 }