Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -26,7 +26,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections;
using System.Collections.Specialized;
using System.Security.Permissions;
@@ -168,4 +167,3 @@ public sealed class HttpSessionState : ICollection, IEnumerable
}
}
}
#endif

View File

@@ -30,7 +30,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
@@ -251,4 +250,3 @@ namespace System.Web.SessionState
}
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections;
using System.Collections.Specialized;
@@ -65,5 +64,4 @@ namespace System.Web.SessionState {
int Timeout { get; set; }
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Web;
@@ -46,5 +45,4 @@ namespace System.Web.SessionState {
bool Validate (string id);
}
}
#endif

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections;
using System.Collections.Specialized;
@@ -47,5 +46,4 @@ namespace System.Web.SessionState {
NameObjectCollectionBase.KeysCollection Keys { get; }
}
}
#endif

View File

@@ -35,9 +35,7 @@ namespace System.Web.SessionState
{
[Guid ("7297744b-e188-40bf-b7e9-56698d25cf44")]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
#if NET_2_0
[ComImportAttribute]
#endif
public interface IStateRuntime
{
void ProcessRequest (
@@ -51,7 +49,6 @@ namespace System.Web.SessionState
[In, MarshalAs(UnmanagedType.I4)] int contentLength,
[In, MarshalAs(UnmanagedType.SysInt)] IntPtr content);
#if NET_2_0
void ProcessRequest (
[In, MarshalAs(UnmanagedType.SysInt)] IntPtr tracker,
[In, MarshalAs(UnmanagedType.I4)] int verb,
@@ -63,7 +60,6 @@ namespace System.Web.SessionState
[In, MarshalAs(UnmanagedType.I4)] int lockCookie,
[In, MarshalAs(UnmanagedType.I4)] int contentLength,
[In, MarshalAs(UnmanagedType.SysInt)] IntPtr content);
#endif
void StopProcessing ();
}
}

View File

@@ -29,7 +29,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Threading;
using System.Web.Caching;
@@ -189,4 +188,3 @@ namespace System.Web.SessionState {
}
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Web;
using System.Web.Configuration;
using System.Web.Util;
@@ -135,4 +134,3 @@ namespace System.Web.SessionState
}
}
}
#endif

View File

@@ -48,19 +48,6 @@ namespace System.Web.SessionState {
return MachineKeySectionUtils.GetHexString (key);
}
#if !NET_2_0
internal static string Lookup (HttpRequest request, bool cookieless)
{
if (cookieless)
return (string) request.Headers [SessionStateModule.HeaderName];
HttpCookie cookie = request.Cookies [SessionStateModule.CookieName];
if (cookie == null)
return null;
return cookie.Value;
}
#endif
}
}

View File

@@ -28,7 +28,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.IO;
using System.Collections;
@@ -458,4 +457,3 @@ namespace System.Web.SessionState
}
}
}
#endif

View File

@@ -30,7 +30,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
@@ -334,41 +333,30 @@ namespace System.Web.SessionState
string Serialize (SessionStateItemCollection items)
{
#if NET_4_0
GZipStream gzip = null;
#endif
Stream output;
MemoryStream ms = null;
BinaryWriter writer = null;
try {
ms = new MemoryStream ();
#if NET_4_0
if (sessionConfig.CompressionEnabled)
output = gzip = new GZipStream (ms, CompressionMode.Compress, true);
else
#endif
output = ms;
writer = new BinaryWriter (output);
if (items != null)
items.Serialize (writer);
#if NET_4_0
if (gzip != null)
gzip.Close ();
#endif
writer.Close ();
return Convert.ToBase64String (ms.ToArray ());
} finally {
#if NET_4_0
if (writer != null)
writer.Dispose ();
if (gzip != null)
gzip.Dispose ();
#else
if (writer != null)
((IDisposable)writer).Dispose ();
#endif
if (ms != null)
ms.Dispose ();
}
@@ -379,41 +367,30 @@ namespace System.Web.SessionState
MemoryStream ms = null;
Stream input;
BinaryReader reader = null;
#if NET_4_0
GZipStream gzip = null;
#endif
try {
ms = new MemoryStream (Convert.FromBase64String (serializedItems));
var sessionItems = new SessionStateItemCollection ();
if (ms.Length > 0) {
#if NET_4_0
if (sessionConfig.CompressionEnabled)
input = gzip = new GZipStream (ms, CompressionMode.Decompress, true);
else
#endif
input = ms;
reader = new BinaryReader (input);
sessionItems = SessionStateItemCollection.Deserialize (reader);
#if NET_4_0
if (gzip != null)
gzip.Close ();
#endif
reader.Close ();
}
return new SessionStateStoreData (sessionItems, SessionStateUtility.GetSessionStaticObjects (context), timeout);
} finally {
#if NET_4_0
if (reader != null)
reader.Dispose ();
if (gzip != null)
gzip.Dispose ();
#else
if (reader != null)
((IDisposable)reader).Dispose ();
#endif
if (ms != null)
ms.Dispose ();
}
@@ -578,4 +555,3 @@ namespace System.Web.SessionState
}
}
#endif

View File

@@ -26,12 +26,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Web.SessionState {
public enum SessionStateActions {
None = 0,
InitializeItem = 1
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
@@ -138,4 +137,3 @@ namespace System.Web.SessionState
}
}
}
#endif

View File

@@ -28,11 +28,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Web.SessionState
{
public delegate void SessionStateItemExpireCallback (
string id, SessionStateStoreData item);
}
#endif

View File

@@ -34,9 +34,7 @@ public enum SessionStateMode
InProc = 1,
StateServer = 2,
SQLServer = 3,
#if NET_2_0
Custom = 4,
#endif
}
}

View File

@@ -30,7 +30,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections.Specialized;
using System.ComponentModel;
using System.Web.Configuration;
@@ -130,15 +129,6 @@ namespace System.Web.SessionState
break;
case SessionStateMode.Off:
return;
#if TARGET_J2EE
default:
config = new SessionStateSection ();
config.Mode = SessionStateMode.Custom;
config.CustomProvider = "ServletSessionStateStore";
config.SessionIDManagerType = "Mainsoft.Web.SessionState.ServletSessionIDManager";
config.Providers.Add (new ProviderSettings ("ServletSessionStateStore", "Mainsoft.Web.SessionState.ServletSessionStateStoreProvider"));
goto case SessionStateMode.Custom;
#else
case SessionStateMode.InProc:
settings = new ProviderSettings (null, typeof (SessionInProcHandler).AssemblyQualifiedName);
break;
@@ -154,7 +144,6 @@ namespace System.Web.SessionState
default:
throw new NotImplementedException (String.Format ("The mode '{0}' is not implemented.", config.Mode));
#endif
}
handler = (SessionStateStoreProviderBase) ProvidersHelper.InstantiateProvider (settings, typeof (SessionStateStoreProviderBase));
@@ -304,14 +293,9 @@ namespace System.Web.SessionState
handler.ReleaseItemExclusive (context, container.SessionID, storeLockId);
handler.RemoveItem (context, container.SessionID, storeLockId, storeData);
if (supportsExpiration)
#if TARGET_J2EE
;
else
#else
// Make sure the expiration handler is not called after we will have raised
// the session end event.
handler.SetItemExpireCallback (null);
#endif
SessionStateUtility.RaiseSessionEnd (container, this, args);
}
SessionStateUtility.RemoveHttpSessionStateFromContext (context);
@@ -418,4 +402,3 @@ namespace System.Web.SessionState
}
}
}
#endif

View File

@@ -28,7 +28,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Collections.Specialized;
using System.IO;
using System.IO.Compression;
@@ -101,24 +100,18 @@ namespace System.Web.SessionState
MemoryStream stream = null;
BinaryReader reader = null;
Stream input = null;
#if NET_4_0
GZipStream gzip = null;
#endif
try {
if (item.CollectionData != null && item.CollectionData.Length > 0) {
stream = new MemoryStream (item.CollectionData);
#if NET_4_0
if (config.CompressionEnabled)
input = gzip = new GZipStream (stream, CompressionMode.Decompress, true);
else
#endif
input = stream;
reader = new BinaryReader (input);
items = SessionStateItemCollection.Deserialize (reader);
#if NET_4_0
if (gzip != null)
gzip.Close ();
#endif
reader.Close ();
} else
items = new SessionStateItemCollection ();
@@ -131,15 +124,10 @@ namespace System.Web.SessionState
} finally {
if (stream != null)
stream.Dispose ();
#if NET_4_0
if (reader != null)
reader.Dispose ();
if (gzip != null)
gzip.Dispose ();
#else
if (reader != null)
((IDisposable)reader).Dispose ();
#endif
}
return new SessionStateStoreData (items,
@@ -226,26 +214,20 @@ namespace System.Web.SessionState
MemoryStream stream = null;
BinaryWriter writer = null;
Stream output = null;
#if NET_4_0
GZipStream gzip = null;
#endif
try {
SessionStateItemCollection items = item.Items as SessionStateItemCollection;
if (items != null && items.Count > 0) {
stream = new MemoryStream ();
#if NET_4_0
if (config.CompressionEnabled)
output = gzip = new GZipStream (stream, CompressionMode.Compress, true);
else
#endif
output = stream;
writer = new BinaryWriter (output);
items.Serialize (writer);
#if NET_4_0
if (gzip != null)
gzip.Close ();
#endif
writer.Close ();
collection_data = stream.ToArray ();
}
@@ -256,15 +238,10 @@ namespace System.Web.SessionState
throw new HttpException ("Failed to store session data.", ex);
} finally {
#if NET_4_0
if (writer != null)
writer.Dispose ();
if (gzip != null)
gzip.Dispose ();
#else
if (writer != null)
((IDisposable)writer).Dispose ();
#endif
if (stream != null)
stream.Dispose ();
}
@@ -307,4 +284,3 @@ namespace System.Web.SessionState
}
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Web;
@@ -63,4 +62,3 @@ namespace System.Web.SessionState {
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Configuration.Provider;
using System.Web;
@@ -72,4 +71,3 @@ namespace System.Web.SessionState
public abstract bool SetItemExpireCallback (SessionStateItemExpireCallback expireCallback);
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Web.SessionState
{
public static class SessionStateUtility
@@ -74,4 +73,3 @@ namespace System.Web.SessionState
}
}
}
#endif

Some files were not shown because too many files have changed in this diff Show More