2004-10-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 10 Oct 2004 13:34:58 +0000 (13:34 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 10 Oct 2004 13:34:58 +0000 (13:34 -0000)
* System.Web/TraceContext.cs: don't cast to Page is the handler it's
not a page.

* System.Web.Configuration/WebConfigurationSettings.cs: use
CurrentExecutionFilePath instead of FilePath. Fixes bug #67982.

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

mcs/class/System.Web/System.Web.Configuration/ChangeLog
mcs/class/System.Web/System.Web.Configuration/WebConfigurationSettings.cs
mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/TraceContext.cs

index 186fb4763a7f5e6fca9cd160c772089734036c08..3cf39785840e5dd2008d419396978281aa349887 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * WebConfigurationSettings.cs: use CurrentExecutionFilePath instead of
+       FilePath. Fixes bug #67982.
+
 2004-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * WebConfigurationSettings.cs: fix bug when processing empty location
index ee47037cbfa9dc306800dae0fc9f869949b016e2..0d212d76cc12b0fe08db6e781f99a4142dd61cd6 100644 (file)
@@ -148,7 +148,7 @@ namespace System.Web.Configuration
                        if (context == null)
                                return null;
 
-                       ConfigurationData config = GetConfigFromFileName (context.Request.FilePath, context);
+                       ConfigurationData config = GetConfigFromFileName (context.Request.CurrentExecutionFilePath, context);
                        if (config == null)
                                return null;
 
@@ -213,6 +213,9 @@ namespace System.Web.Configuration
 
                public void Init (HttpContext context)
                {
+                       if (initCalled)
+                               return;
+
                        lock (this) {
                                if (initCalled)
                                        return;
@@ -251,7 +254,7 @@ namespace System.Web.Configuration
                 public FileWatcherCache (ConfigurationData data)
                 {
                        this.data = data;
-                        cacheTable = Hashtable.Synchronized (new Hashtable ());
+                       cacheTable = new Hashtable ();
                        this.path = Path.GetDirectoryName (data.FileName);
                        this.filename = Path.GetFileName (data.FileName);
                        if (!Directory.Exists (path))
@@ -539,7 +542,7 @@ namespace System.Web.Configuration
                public object GetConfig (string sectionName, HttpContext context)
                {
                        if (locations != null && dirname != null) {
-                               string reduced = UrlUtils.MakeRelative (context.Request.FilePath, dirname);
+                               string reduced = UrlUtils.MakeRelative (context.Request.CurrentExecutionFilePath, dirname);
                                string [] parts = reduced.Split ('/');
                                Location location = null;
                                int length = parts.Length;
index b771480efe0a11ad2321939abb8a212b4ec828fb..4130f7476c23467263c2998316d0a2792d71a868 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * TraceContext.cs: don't cast to Page is the handler it's
+       not a page.
+
 2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * HttpRequest.cs: CurrentExecutionFilePath is the one that
index f4ad22af99deb9c97c2e40c1b2783d1432abfdc7..efa37b06471a4bc0ef539a00e582cfd983577512 100644 (file)
@@ -118,7 +118,9 @@ namespace System.Web {
                    if (data == null)\r
                            data = new TraceData ();\r
                   SetRequestDetails ();\r
-                  data.AddControlTree ((Page) _Context.Handler);\r
+                  if (_Context.Handler is Page)
+                          data.AddControlTree ((Page) _Context.Handler);
+
                   AddCookies ();\r
                   AddHeaders ();\r
                   AddServerVars ();\r