Jelajahi Sumber

2007-07-31 Marek Habersack <[email protected]>

	* SessionInProcHandler.cs: initialize the static session objects
	collection from the application state instead of using
	SessionStateUtility.GetSessionStaticObjects. Fixes bug #82193
	* SessionStateServerHandler.cs: as above
	

svn path=/trunk/mcs/; revision=83072
Marek Habersack 18 tahun lalu
induk
melakukan
ee53884fda

+ 7 - 0
mcs/class/System.Web/System.Web.SessionState_2.0/ChangeLog

@@ -1,3 +1,10 @@
+2007-07-31  Marek Habersack  <[email protected]>
+
+	* SessionInProcHandler.cs: initialize the static session objects
+	collection from the application state instead of using
+	SessionStateUtility.GetSessionStaticObjects. Fixes bug #82193
+	* SessionStateServerHandler.cs: as above
+	
 2007-07-30  Igor Zelmanovich <[email protected]>
 
 	* SessionStateModule.cs:

+ 3 - 3
mcs/class/System.Web/System.Web.SessionState_2.0/SessionInProcHandler.cs

@@ -77,7 +77,7 @@ namespace System.Web.SessionState
 		public override SessionStateStoreData CreateNewStoreData (HttpContext context, int timeout)
 		{
 			return new SessionStateStoreData (new SessionStateItemCollection (),
-							  SessionStateUtility.GetSessionStaticObjects(context),
+							  HttpApplicationFactory.ApplicationState.SessionObjects,
 							  timeout);
 		}
 
@@ -156,7 +156,7 @@ namespace System.Web.SessionState
 					item.items = new SessionStateItemCollection ();
 				}
 				return new SessionStateStoreData (item.items,
-								  SessionStateUtility.GetSessionStaticObjects(context),
+								  HttpApplicationFactory.ApplicationState.SessionObjects,
 								  item.timeout);
 			} catch {
 				// we want such errors to be passed to the application.
@@ -344,7 +344,7 @@ namespace System.Web.SessionState
 					expireCallback (key,
 							new SessionStateStoreData (
 								item.items,
-								SessionStateUtility.GetSessionStaticObjects (HttpContext.Current),
+								HttpApplicationFactory.ApplicationState.SessionObjects,
 								item.timeout));
 				} else
 					expireCallback (key, null);

+ 9 - 1
mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateServerHandler.cs

@@ -47,7 +47,7 @@ namespace System.Web.SessionState
 		public override SessionStateStoreData CreateNewStoreData (HttpContext context, int timeout)
 		{
 			return new SessionStateStoreData (new SessionStateItemCollection (),
-							  SessionStateUtility.GetSessionStaticObjects(context),
+							  HttpApplicationFactory.ApplicationState.SessionObjects,
 							  timeout);
 		}
 		
@@ -73,9 +73,11 @@ namespace System.Web.SessionState
 						       out SessionStateActions actions,
 						       bool exclusive)
 		{
+#if TRACE
 			Console.WriteLine ("SessionStateServerHandler.GetItemInternal");
 			Console.WriteLine ("\tid == {0}", id);
 			Console.WriteLine ("\tpath == {0}", context.Request.FilePath);
+#endif
 			locked = false;
 			lockAge = TimeSpan.MinValue;
 			lockId = Int32.MinValue;
@@ -92,11 +94,15 @@ namespace System.Web.SessionState
 								    exclusive);
 			
 			if (item == null) {
+#if TRACE
 				Console.WriteLine ("\titem is null (locked == {0}, actions == {1})", locked, actions);
+#endif
 				return null;
 			}
 			if (actions == SessionStateActions.InitializeItem) {
+#if TRACE
 				Console.WriteLine ("\titem needs initialization");
+#endif
 				return CreateNewStoreData (context, item.Timeout);
 			}
 			SessionStateItemCollection items = null;
@@ -150,7 +156,9 @@ namespace System.Web.SessionState
 
 		public override void Initialize (string name, NameValueCollection config)
 		{
+#if TRACE
 			Console.WriteLine ("SessionStateServerHandler.Initialize");
+#endif
 			if (String.IsNullOrEmpty (name))
 				name = "Session Server handler";
 			privateConfig = config;