2007-04-05 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Thu, 5 Apr 2007 11:23:18 +0000 (11:23 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Thu, 5 Apr 2007 11:23:18 +0000 (11:23 -0000)
* ApplicationHost.cs: make ApplicationName/domain id really
unique.

svn path=/trunk/mcs/; revision=75424

mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
mcs/class/System.Web/System.Web.Hosting/ChangeLog

index 0d44f164a3e36299a948e431b202f8c3e5996c87..c222f107854bea3214d34cfbdd9a8aba788bf87f 100644 (file)
@@ -104,11 +104,6 @@ namespace System.Web.Hosting {
                                throw new ArgumentNullException ("virtualDir");
 
                        Evidence evidence = new Evidence (AppDomain.CurrentDomain.Evidence);
-
-                       // 
-                       // Unique Domain ID
-                       //
-                       string domain_id = (virtualDir + physicalDir).GetHashCode ().ToString ("x");
                        
                        //
                        // Setup
@@ -118,7 +113,6 @@ namespace System.Web.Hosting {
                        setup.ApplicationBase = physicalDir;
 
                        setup.CachePath = null;
-                       setup.ApplicationName = domain_id;
                        setup.ConfigurationFile = FindWebConfig (physicalDir);
                        setup.DisallowCodeDownload = true;
                        string bin_path = GetBinPath (physicalDir);
@@ -129,6 +123,8 @@ namespace System.Web.Hosting {
 
                        string dynamic_dir = null;
                        string user = Environment.UserName;
+                       int tempDirTag = 0;
+                       
                        for (int i = 0; ; i++){
                                string d = Path.Combine (Path.GetTempPath (),
                                        String.Format ("{0}-temp-aspnet-{1:x}", user, i));
@@ -139,11 +135,18 @@ namespace System.Web.Hosting {
                                        CreateDirectory (stamp);
                                        dynamic_dir = d;
                                        Directory.Delete (stamp);
+                                       tempDirTag = i.GetHashCode ();
                                        break;
                                } catch (UnauthorizedAccessException){
                                        continue;
                                }
                        }
+                       // 
+                       // Unique Domain ID
+                       //
+                       string domain_id = (virtualDir.GetHashCode () ^ physicalDir.GetHashCode () ^ tempDirTag).ToString ("x");
+
+                       setup.ApplicationName = domain_id;
                        setup.DynamicBase = dynamic_dir;
                        CreateDirectory (setup.DynamicBase);
 
index fff1de2a0b09b012121918fe71ea3546a7ad1971..5089b02afeb863bbccc7ef8592b9b7790ef704a3 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-05  Marek Habersack  <mhabersack@novell.com>
+
+       * ApplicationHost.cs: make ApplicationName/domain id really
+       unique.
+
 2007-02-21  Marek Habersack  <grendello@gmail.com>
 
        * ApplicationHost.cs: support both Bin and bin directories, prefer