From 5fc0e4ef18f2f1bd237fb18092bdc5d392ed0887 Mon Sep 17 00:00:00 2001 From: Eyal Alalouf Date: Mon, 25 Jul 2005 14:11:24 +0000 Subject: [PATCH] Timeout of handling requests is not supported in TARGET_J2EE (Thread.Abort not supported) svn path=/trunk/mcs/; revision=47652 --- mcs/class/System.Web/ChangeLog | 3 +++ mcs/class/System.Web/System.Web.vmwcsproj | 1 - mcs/class/System.Web/System.Web/ChangeLog | 4 ++++ .../System.Web/System.Web/HttpApplication.cs | 18 ++++++++---------- mcs/class/System.Web/System.Web/HttpContext.cs | 11 ----------- mcs/class/System.Web/System.Web/HttpRuntime.cs | 9 ++++++++- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mcs/class/System.Web/ChangeLog b/mcs/class/System.Web/ChangeLog index c4ef719bbb4..c2e188d5178 100644 --- a/mcs/class/System.Web/ChangeLog +++ b/mcs/class/System.Web/ChangeLog @@ -1,3 +1,6 @@ +2005-07-25 Eyal Alalouf + * System.Web.vmwcsproj removed System.Web/TimeoutManager.cs from TARGET_J2EE + 2005-07-24 Eyal Alalouf * System.Web.vmwcsproj added System.Web.UI/PageHandlerFactory.jvm.cs diff --git a/mcs/class/System.Web/System.Web.vmwcsproj b/mcs/class/System.Web/System.Web.vmwcsproj index 1d169c25e62..aa415d41b88 100644 --- a/mcs/class/System.Web/System.Web.vmwcsproj +++ b/mcs/class/System.Web/System.Web.vmwcsproj @@ -98,7 +98,6 @@ - diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index 6542bea490a..112a386e62b 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,7 @@ +2005-07-25 Eyal Alalouf + * HttpContext.cs HttpRuntime.cs HttpApplication.cs: timeout is not supported + in TARGET_J2EE configuration (no Thread.Abort support). + 2005-07-25 Eyal Alalouf * QueueManager.cs: TARGET_J2EE fixes. * HttpApplicationFactory.cs: TARGET_J2EE fixes. diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs index 4fde2571446..5e3dfb43931 100644 --- a/mcs/class/System.Web/System.Web/HttpApplication.cs +++ b/mcs/class/System.Web/System.Web/HttpApplication.cs @@ -1056,10 +1056,10 @@ namespace System.Web internal void Start () { Reset (); -#if !TARGET_J2EE - ExecuteNextAsync (null); -#else +#if TARGET_J2EE ExecuteNext(null); +#else + ExecuteNextAsync (null); #endif } @@ -1138,7 +1138,7 @@ namespace System.Web #if TARGET_J2EE private Exception HandleJavaException(Exception obj) { - Exception lasterror = null; + Exception lasterror = obj; if (obj is System.Reflection.TargetInvocationException ) { @@ -1181,12 +1181,6 @@ namespace System.Web _app.Context.EndTimeoutPossible (); } } -#if TARGET_J2EE //Catch case of aborting by timeout - if (_app.Context.TimedOut) { - _app.CompleteRequest (); - return null; - } -#endif if (state.PossibleToTimeout) { // Async Execute _app.Context.TryWaitForTimeout (); @@ -1386,14 +1380,18 @@ namespace System.Web SaveThreadCulture (); _savedContext = HttpContext.Context; HttpContext.Context = _Context; +#if !TARGET_J2EE HttpRuntime.TimeoutManager.Add (_Context); +#endif SetPrincipal (_Context.User); } internal void OnStateExecuteLeave () { RestoreThreadCulture (); +#if !TARGET_J2EE HttpRuntime.TimeoutManager.Remove (_Context); +#endif HttpContext.Context = _savedContext; RestorePrincipal (); } diff --git a/mcs/class/System.Web/System.Web/HttpContext.cs b/mcs/class/System.Web/System.Web/HttpContext.cs index b7c049f55ec..478427f14e2 100644 --- a/mcs/class/System.Web/System.Web/HttpContext.cs +++ b/mcs/class/System.Web/System.Web/HttpContext.cs @@ -231,17 +231,6 @@ namespace System.Web } #endif -#if TARGET_J2EE - private bool _timedOut; - internal bool TimedOut { - get { - return _timedOut; - } - set { - _timedOut = value; - } - } -#endif public IDictionary Items { get { diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs index 72a4d589f86..a9c35929b76 100644 --- a/mcs/class/System.Web/System.Web/HttpRuntime.cs +++ b/mcs/class/System.Web/System.Web/HttpRuntime.cs @@ -86,7 +86,9 @@ namespace System.Web { //private bool _firstRequestExecuted; private Exception _initError; +#if !TARGET_J2EE private TimeoutManager timeoutManager; +#endif private QueueManager queueManager; private TraceManager traceManager; private WaitCallback doRequestCallback; @@ -113,7 +115,9 @@ namespace System.Web { { try { _cache = new Cache (); +#if !TARGET_J2EE timeoutManager = new TimeoutManager (); +#endif _endOfSendCallback = new HttpWorkerRequest.EndOfSendNotification (OnEndOfSend); _handlerCallback = new AsyncCallback (OnHandlerReady); @@ -276,7 +280,8 @@ namespace System.Web { internal void Dispose() { WaitForRequests (2000); - queueManager.Dispose (); // Send a 503 to all queued requests + if (queueManager != null) + queueManager.Dispose (); // Send a 503 to all queued requests queueManager = null; _cache = null; HttpApplicationFactory.EndApplication(); @@ -496,11 +501,13 @@ namespace System.Web { } } +#if !TARGET_J2EE internal static TimeoutManager TimeoutManager { get { return HttpRuntime._runtime.timeoutManager; } } +#endif internal static TraceManager TraceManager { get { -- 2.25.1