فهرست منبع

Timeout of handling requests is not supported in TARGET_J2EE (Thread.Abort not supported)

svn path=/trunk/mcs/; revision=47652
Eyal Alalouf 20 سال پیش
والد
کامیت
5fc0e4ef18

+ 3 - 0
mcs/class/System.Web/ChangeLog

@@ -1,3 +1,6 @@
+2005-07-25  Eyal Alalouf  <[email protected]>
+	* System.Web.vmwcsproj removed System.Web/TimeoutManager.cs from TARGET_J2EE
+
 2005-07-24  Eyal Alalouf  <[email protected]>
 	* System.Web.vmwcsproj added System.Web.UI/PageHandlerFactory.jvm.cs
 

+ 0 - 1
mcs/class/System.Web/System.Web.vmwcsproj

@@ -98,7 +98,6 @@
 				<File RelPath="System.Web\SiteMapResolveEventArgs.cs" SubType="Code" BuildAction="Compile"/>
 				<File RelPath="System.Web\StaticFileHandler.cs" SubType="Code" BuildAction="Compile"/>
 				<File RelPath="System.Web\StaticSiteMapProvider.cs" SubType="Code" BuildAction="Compile"/>
-				<File RelPath="System.Web\TimeoutManager.cs" SubType="Code" BuildAction="Compile"/>
 				<File RelPath="System.Web\TraceContext.cs" SubType="Code" BuildAction="Compile"/>
 				<File RelPath="System.Web\TraceData.cs" SubType="Code" BuildAction="Compile"/>
 				<File RelPath="System.Web\TraceManager.cs" SubType="Code" BuildAction="Compile"/>

+ 4 - 0
mcs/class/System.Web/System.Web/ChangeLog

@@ -1,3 +1,7 @@
+2005-07-25  Eyal Alalouf  <[email protected]>
+	* HttpContext.cs HttpRuntime.cs HttpApplication.cs: timeout is not supported
+	  in TARGET_J2EE configuration (no Thread.Abort support).
+
 2005-07-25  Eyal Alalouf  <[email protected]>
 	* QueueManager.cs: TARGET_J2EE fixes.
 	* HttpApplicationFactory.cs: TARGET_J2EE fixes.

+ 8 - 10
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 ();
 		}

+ 0 - 11
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 {

+ 8 - 1
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 {