Author: gonzalo
Date: 2005-05-03 13:51:42 -0400 (Tue, 03 May 2005)
New Revision: 43966

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

        * ServicePoint.cs: HostEntry needs to be thread safe.



Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2005-05-03 17:51:19 UTC (rev 
43965)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2005-05-03 17:51:42 UTC (rev 
43966)
@@ -1,5 +1,9 @@
 2005-05-03 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
+       * ServicePoint.cs: HostEntry needs to be thread safe.
+
+2005-05-03 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
        * WebConnection.cs: removed a 'slightly' important line by mistake.
        * WebConnectionStream.cs: if the transfer encoding is chunked, ignore
        content-length header if present.

Modified: trunk/mcs/class/System/System.Net/ServicePoint.cs
===================================================================
--- trunk/mcs/class/System/System.Net/ServicePoint.cs   2005-05-03 17:51:19 UTC 
(rev 43965)
+++ trunk/mcs/class/System/System.Net/ServicePoint.cs   2005-05-03 17:51:42 UTC 
(rev 43966)
@@ -54,6 +54,7 @@
                bool sendContinue = true;
                bool useConnect;
                object locker = new object ();
+               object hostE = new object ();
 #if NET_1_1
                bool useNagle;
 #endif
@@ -187,7 +188,10 @@
                internal IPHostEntry HostEntry
                {
                        get {
-                               if (host == null) {
+                               lock (hostE) {
+                                       if (host != null)
+                                               return host;
+
                                        string uriHost = uri.Host;
 
                                        // There is no need to do DNS 
resolution on literal IP addresses

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

Reply via email to