Author: gonzalo
Date: 2005-05-04 03:54:21 -0400 (Wed, 04 May 2005)
New Revision: 44008

Modified:
   trunk/mcs/class/System/System.Net/ChangeLog
   trunk/mcs/class/System/System.Net/WebConnection.cs
Log:
2005-05-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * WebConnection.cs: don't rethrow errors in Write, as the error will be
        received by GetResponse*. The result is that the threadpool thread doing
        this will not end up printing the exception. Fixes bug #74817.



Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2005-05-04 07:10:20 UTC (rev 
44007)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2005-05-04 07:54:21 UTC (rev 
44008)
@@ -1,3 +1,9 @@
+2005-05-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * WebConnection.cs: don't rethrow errors in Write, as the error will be
+       received by GetResponse*. The result is that the threadpool thread doing
+       this will not end up printing the exception. Fixes bug #74817.
+
 2005-05-03 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * ServicePoint.cs: HostEntry needs to be thread safe.

Modified: trunk/mcs/class/System/System.Net/WebConnection.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebConnection.cs  2005-05-04 07:10:20 UTC 
(rev 44007)
+++ trunk/mcs/class/System/System.Net/WebConnection.cs  2005-05-04 07:54:21 UTC 
(rev 44008)
@@ -245,6 +245,7 @@
                                                                                
request.ClientCertificates,
                                                                                
request, buffer};
                                                nstream = (Stream) 
Activator.CreateInstance (sslStream, args);
+                                               certsAvailable = false;
                                        }
                                        // we also need to set 
ServicePoint.Certificate 
                                        // and ServicePoint.ClientCertificate 
but this can
@@ -809,18 +810,20 @@
                                if (ssl && !certsAvailable)
                                        GetCertificates ();
                        } catch (Exception e) {
-                               if (e is WebException)
-                                       throw e;
-
                                WebExceptionStatus wes = 
WebExceptionStatus.SendFailure;
+                               string msg = "Write";
+                               if (e is WebException) {
+                                       HandleError (wes, e, msg);
+                                       return;
+                               }
 
                                // if SSL is in use then check for TrustFailure
                                if (ssl && (bool) piTrustFailure.GetValue 
(nstream, null)) {
                                        wes = WebExceptionStatus.TrustFailure;
+                                       msg = "Trust failure";
                                }
 
-                               HandleError (wes, e, "Write");
-                               throw new WebException ("Not connected", e, 
wes, null);
+                               HandleError (wes, e, msg);
                        }
                }
 

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

Reply via email to