Author: gonzalo
Date: 2006-09-26 12:49:20 -0400 (Tue, 26 Sep 2006)
New Revision: 65926

Modified:
   trunk/mcs/class/System.Web/System.Web/ChangeLog
   trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
   trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs
   trunk/mcs/class/System.Web/System.Web/QueueManager.cs
Log:
2006-09-26 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * QueueManager.cs: if disposed, always return null for next request.
        * HttpRuntime.cs: dispose the queue manager when shutting down the
        domain. This will close pending requests with a 503.
        * HttpApplication.cs: release the handler before marking the request
        as completed. If in PipelineDone context is null, use
        HttpContext.Current. Fixes some of those "Tick detected an unhandled
        exception" errors printed out.



Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog     2006-09-26 16:40:58 UTC 
(rev 65925)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog     2006-09-26 16:49:20 UTC 
(rev 65926)
@@ -1,3 +1,13 @@
+2006-09-26 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * QueueManager.cs: if disposed, always return null for next request.
+       * HttpRuntime.cs: dispose the queue manager when shutting down the
+       domain. This will close pending requests with a 503.
+       * HttpApplication.cs: release the handler before marking the request
+       as completed. If in PipelineDone context is null, use
+       HttpContext.Current. Fixes some of those "Tick detected an unhandled
+       exception" errors printed out.
+
 2006-09-11  Andrew Skiba <[EMAIL PROTECTED]>
 
        * XmlSiteMapProvider.cs: ifdef TARGET_JVM

Modified: trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpApplication.cs    2006-09-26 
16:40:58 UTC (rev 65925)
+++ trunk/mcs/class/System.Web/System.Web/HttpApplication.cs    2006-09-26 
16:49:20 UTC (rev 65926)
@@ -787,12 +787,17 @@
                        }
 
                        try {
-
                                OutputPage ();
                        } catch (Exception e) {
                                Console.WriteLine ("Internal error: OutputPage 
threw an exception " + e);
                        } finally {
                                context.WorkerRequest.EndOfRequest();
+                               if (factory != null && context.Handler != null){
+                                       factory.ReleaseHandler 
(context.Handler);
+                                       context.Handler = null;
+                                       factory = null;
+                               }
+                               
                                if (begin_iar != null){
                                        try {
                                                begin_iar.Complete ();
@@ -802,17 +807,13 @@
                                                // Not really too bad, since 
the only failure might be
                                                // 
`HttpRuntime.request_processed'
                                                //
+                                       } finally {
+                                               done.Set ();
                                        }
+                               } else {
+                                       done.Set ();
                                }
                                
-                               done.Set ();
-
-                               if (factory != null && context.Handler != null){
-                                       factory.ReleaseHandler 
(context.Handler);
-                                       factory = null;
-                               }
-                               
-                               context.Handler = null;
                                // context = null; -> moved to PostDone
                                pipeline = null;
                                current_ai = null;
@@ -1018,6 +1019,8 @@
                                th.CurrentCulture = prev_app_culture;
 
 #if !TARGET_J2EE
+                       if (context == null)
+                               context = HttpContext.Current;
                        HttpRuntime.TimeoutManager.Remove (context);
 #endif
                        context = null;

Modified: trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs        2006-09-26 
16:40:58 UTC (rev 65925)
+++ trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs        2006-09-26 
16:49:20 UTC (rev 65926)
@@ -320,6 +320,7 @@
                //
                static void ShutdownAppDomain (object args)
                {
+                       queue_manager.Dispose ();
                        // This will call Session_End if needed.
                        Cache.InvokePrivateCallbacks ();
                        // Kill our application.

Modified: trunk/mcs/class/System.Web/System.Web/QueueManager.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/QueueManager.cs       2006-09-26 
16:40:58 UTC (rev 65925)
+++ trunk/mcs/class/System.Web/System.Web/QueueManager.cs       2006-09-26 
16:49:20 UTC (rev 65926)
@@ -78,7 +78,7 @@
                public HttpWorkerRequest GetNextRequest (HttpWorkerRequest req)
                {
                        if (!CanExecuteRequest (req)) {
-                               if (req != null) {
+                               if (!disposing && req != null) {
                                        lock (queue) {
                                                Queue (req);
                                        }

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

Reply via email to