diff options
-rw-r--r-- | mcs/class/System/System.Net/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/System/System.Net/WebConnection.cs | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog index 928f21e3bff..52d120a9868 100644 --- a/mcs/class/System/System.Net/ChangeLog +++ b/mcs/class/System/System.Net/ChangeLog @@ -1,3 +1,9 @@ +2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * 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 <gonzalo@ximian.com> * ServicePoint.cs: HostEntry needs to be thread safe. diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs index c8370a004f8..537d5843325 100644 --- a/mcs/class/System/System.Net/WebConnection.cs +++ b/mcs/class/System/System.Net/WebConnection.cs @@ -245,6 +245,7 @@ namespace System.Net 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 @@ namespace System.Net 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); } } |