Author: kostat
Date: 2008-01-20 10:58:57 -0500 (Sun, 20 Jan 2008)
New Revision: 93350

Modified:
   trunk/mcs/class/System.Web/System.Web.Profile/ProfileModule.cs
   trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
Log:
TARGET_JVM: call ProfileModule's OnLeave when the action phase ends

Modified: trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpApplication.cs    2008-01-20 
15:56:18 UTC (rev 93349)
+++ trunk/mcs/class/System.Web/System.Web/HttpApplication.cs    2008-01-20 
15:58:57 UTC (rev 93350)
@@ -1018,6 +1018,12 @@
                        }
 #if TARGET_J2EE
                        if (doProcessHandler) {
+                               foreach (IHttpModule module in Modules) {
+                                       if (module is 
System.Web.Profile.ProfileModule) {
+                                               
((System.Web.Profile.ProfileModule) module).OnLeave (this, EventArgs.Empty);
+                                               break;
+                                       }
+                               }
                                yield return false;
                                goto processHandler;
                        }

Modified: trunk/mcs/class/System.Web/System.Web.Profile/ProfileModule.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Profile/ProfileModule.cs      
2008-01-20 15:56:18 UTC (rev 93349)
+++ trunk/mcs/class/System.Web/System.Web.Profile/ProfileModule.cs      
2008-01-20 15:58:57 UTC (rev 93350)
@@ -40,6 +40,10 @@
                ProfileBase profile;
                string anonymousCookieName = null;
 
+#if TARGET_J2EE
+               bool _OnLeaveCalled;
+#endif
+
                public ProfileModule ()
                {
                }
@@ -70,6 +74,10 @@
                        if (!ProfileManager.Enabled)
                                return;
 
+#if TARGET_J2EE
+                       _OnLeaveCalled = false;
+#endif
+
                        if (HttpContext.Current.Request.IsAuthenticated) {
                                HttpCookie cookie = app.Request.Cookies 
[anonymousCookieName];
                                if (cookie != null && (cookie.Expires != 
DateTime.MinValue && cookie.Expires > DateTime.Now)) {
@@ -87,7 +95,9 @@
                                }
                        }
                }
-
+#if TARGET_J2EE
+               internal
+#endif
                void OnLeave (object o, EventArgs eventArgs)
                {
                        if (!ProfileManager.Enabled)
@@ -95,6 +105,13 @@
 
                        if (!app.Context.ProfileInitialized)
                                return;
+
+#if TARGET_J2EE
+                       if (_OnLeaveCalled)
+                               return;
+
+                       _OnLeaveCalled = true;
+#endif
 
                        if (ProfileManager.AutomaticSaveEnabled) {
                                profile = app.Context.Profile;

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to