You've already forked linux-packaging-mono
Imported Upstream version 3.10.0
Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
@ -56,10 +56,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly: NeutralResourcesLanguage ("en-US")]
|
||||
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
|
||||
|
||||
#if !TARGET_JVM
|
||||
[assembly: AssemblyDelaySign (true)]
|
||||
[assembly: AssemblyKeyFile("../ecma.pub")]
|
||||
#endif
|
||||
|
||||
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
|
||||
[assembly: CLSCompliant (false)]
|
||||
|
@ -1,128 +0,0 @@
|
||||
//
|
||||
// System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory
|
||||
//
|
||||
// Authors:
|
||||
// Martin Willemoes Hansen (mwh@sysrq.dk)
|
||||
// Lluis Sanchez Gual (lluis@ximian.com)
|
||||
//
|
||||
// (C) 2003 Martin Willemoes Hansen
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Web;
|
||||
using System.IO;
|
||||
using System.Runtime.Remoting;
|
||||
using System.Runtime.Remoting.Channels;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Http
|
||||
{
|
||||
public class HttpRemotingHandlerFactory : IHttpHandlerFactory
|
||||
{
|
||||
public HttpRemotingHandlerFactory ()
|
||||
{
|
||||
}
|
||||
|
||||
private static HttpRemotingHandlerFactoryData CurrentHttpRemotingHandlerFactoryData
|
||||
{
|
||||
get
|
||||
{
|
||||
HttpRemotingHandlerFactoryData res = (HttpRemotingHandlerFactoryData)AppDomain.CurrentDomain.GetData("HttpRemotingHandlerFactory");
|
||||
if (res == null)
|
||||
{
|
||||
res = new HttpRemotingHandlerFactoryData();
|
||||
AppDomain.CurrentDomain.SetData("HttpRemotingHandlerFactory", res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
public IHttpHandler GetHandler (HttpContext context,
|
||||
string verb,
|
||||
string url,
|
||||
string filePath)
|
||||
{
|
||||
if (!CurrentHttpRemotingHandlerFactoryData.webConfigLoaded)
|
||||
ConfigureHttpChannel (context);
|
||||
|
||||
return new HttpRemotingHandler (CurrentHttpRemotingHandlerFactoryData.transportSink);
|
||||
}
|
||||
|
||||
void ConfigureHttpChannel (HttpContext context)
|
||||
{
|
||||
lock (GetType())
|
||||
{
|
||||
if (CurrentHttpRemotingHandlerFactoryData.webConfigLoaded) return;
|
||||
|
||||
// Look for a channel that wants to receive http request
|
||||
IChannelReceiverHook chook = null;
|
||||
foreach (IChannel channel in ChannelServices.RegisteredChannels)
|
||||
{
|
||||
chook = channel as IChannelReceiverHook;
|
||||
if (chook == null) continue;
|
||||
|
||||
if (chook.ChannelScheme != "http")
|
||||
throw new RemotingException ("Only http channels are allowed when hosting remoting objects in a web server");
|
||||
|
||||
if (!chook.WantsToListen)
|
||||
{
|
||||
chook = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
//found chook
|
||||
break;
|
||||
}
|
||||
|
||||
if (chook == null)
|
||||
{
|
||||
HttpChannel chan = new HttpChannel();
|
||||
ChannelServices.RegisterChannel(chan);
|
||||
chook = chan;
|
||||
}
|
||||
|
||||
// Register the uri for the channel. The channel uri includes the scheme, the
|
||||
// host and the application path
|
||||
|
||||
string channelUrl = context.Request.Url.GetLeftPart(UriPartial.Authority);
|
||||
channelUrl += context.Request.ApplicationPath;
|
||||
chook.AddHookChannelUri (channelUrl);
|
||||
|
||||
CurrentHttpRemotingHandlerFactoryData.transportSink = new HttpServerTransportSink (chook.ChannelSinkChain, null);
|
||||
|
||||
CurrentHttpRemotingHandlerFactoryData.webConfigLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void ReleaseHandler (IHttpHandler handler)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
internal class HttpRemotingHandlerFactoryData
|
||||
{
|
||||
|
||||
internal bool webConfigLoaded = false;
|
||||
internal HttpServerTransportSink transportSink = null;
|
||||
|
||||
}
|
||||
}
|
@ -65,10 +65,8 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
public static void Shutdown ()
|
||||
{
|
||||
#if !TARGET_JVM
|
||||
if (_poolThread != null)
|
||||
_poolThread.Abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static int MaxOpenConnections
|
||||
|
@ -56,9 +56,6 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
RemotingThreadPool threadPool;
|
||||
|
||||
#if TARGET_JVM
|
||||
private volatile bool stopped = false;
|
||||
#endif
|
||||
|
||||
void Init (IServerChannelSinkProvider serverSinkProvider)
|
||||
{
|
||||
@ -207,11 +204,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
try
|
||||
{
|
||||
#if !TARGET_JVM
|
||||
while(true)
|
||||
#else
|
||||
while(!stopped)
|
||||
#endif
|
||||
{
|
||||
Socket socket = listener.AcceptSocket ();
|
||||
ClientConnection reader = new ClientConnection (this, socket, sink);
|
||||
@ -236,9 +229,6 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
public void StartListening (object data)
|
||||
{
|
||||
#if TARGET_JVM
|
||||
stopped = false;
|
||||
#endif
|
||||
listener = new TcpListener (bindAddress, port);
|
||||
if (server_thread == null)
|
||||
{
|
||||
@ -261,16 +251,9 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
public void StopListening (object data)
|
||||
{
|
||||
#if TARGET_JVM
|
||||
stopped = true;
|
||||
#endif
|
||||
if (server_thread == null) return;
|
||||
|
||||
#if !TARGET_JVM
|
||||
server_thread.Abort ();
|
||||
#else
|
||||
server_thread.Interrupt ();
|
||||
#endif
|
||||
listener.Stop ();
|
||||
threadPool.Free ();
|
||||
server_thread.Join ();
|
||||
|
@ -98,13 +98,8 @@ namespace System.Runtime.Remoting.Channels
|
||||
RemotingSurrogateSelector surrogateSelector = new RemotingSurrogateSelector ();
|
||||
StreamingContext context = new StreamingContext (StreamingContextStates.Remoting, null);
|
||||
|
||||
#if !TARGET_JVM
|
||||
_serializationFormatter = new BinaryFormatter (surrogateSelector, context);
|
||||
_deserializationFormatter = new BinaryFormatter (null, context);
|
||||
#else
|
||||
_serializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (surrogateSelector, context, false);
|
||||
_deserializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (null, context, false);
|
||||
#endif
|
||||
|
||||
_serializationFormatter.FilterLevel = _filterLevel;
|
||||
_deserializationFormatter.FilterLevel = _filterLevel;
|
||||
|
@ -46,9 +46,6 @@ namespace System.Runtime.Remoting.Channels
|
||||
AutoResetEvent threadDone = new AutoResetEvent (false);
|
||||
ArrayList runningThreads = new ArrayList ();
|
||||
|
||||
#if TARGET_JVM
|
||||
volatile
|
||||
#endif
|
||||
bool stopped = false;
|
||||
|
||||
static object globalLock = new object ();
|
||||
@ -75,11 +72,7 @@ namespace System.Runtime.Remoting.Channels
|
||||
threadDone.Set ();
|
||||
workItems.Clear ();
|
||||
foreach (Thread t in runningThreads)
|
||||
#if !TARGET_JVM
|
||||
t.Abort ();
|
||||
#else
|
||||
t.Interrupt();
|
||||
#endif
|
||||
runningThreads.Clear ();
|
||||
}
|
||||
if (this == sharedPool)
|
||||
@ -138,12 +131,7 @@ namespace System.Runtime.Remoting.Channels
|
||||
|
||||
void PoolThread ()
|
||||
{
|
||||
#if !TARGET_JVM
|
||||
while (true) {
|
||||
#else
|
||||
while (!stopped)
|
||||
{
|
||||
#endif
|
||||
ThreadStart work = null;
|
||||
do {
|
||||
lock (workItems) {
|
||||
|
@ -74,34 +74,6 @@ namespace System.Runtime.Remoting.Channels {
|
||||
if (sf != null) {
|
||||
if(_serverFaultExceptionField != null)
|
||||
e = (Exception) _serverFaultExceptionField.GetValue(sf);
|
||||
#if TARGET_JVM
|
||||
if (e == null && sf.ExceptionType != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Type te = Type.GetType(sf.ExceptionType);
|
||||
if (te != null)
|
||||
{
|
||||
ConstructorInfo ce = te.GetConstructor(
|
||||
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance,
|
||||
null, new Type[] {typeof(string)}, null);
|
||||
|
||||
if (ce != null)
|
||||
{
|
||||
e = (Exception) ce.Invoke(new object[] {sf.ExceptionMessage});
|
||||
}
|
||||
else
|
||||
{
|
||||
e = (Exception) Activator.CreateInstance(te);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
e = null;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (e == null)
|
||||
e = new RemotingException (fault.FaultString);
|
||||
@ -431,12 +403,6 @@ namespace System.Runtime.Remoting.Channels {
|
||||
|
||||
object GetNullValue (Type paramType)
|
||||
{
|
||||
#if TARGET_JVM
|
||||
if (paramType.IsEnum)
|
||||
{
|
||||
return Activator.CreateInstance(paramType);
|
||||
}
|
||||
#endif
|
||||
switch (Type.GetTypeCode (paramType))
|
||||
{
|
||||
case TypeCode.Boolean: return false;
|
||||
@ -453,12 +419,6 @@ namespace System.Runtime.Remoting.Channels {
|
||||
case TypeCode.UInt32: return (uint)0;
|
||||
case TypeCode.UInt64: return (ulong)0;
|
||||
default:
|
||||
#if TARGET_JVM
|
||||
if (paramType.IsValueType)
|
||||
{
|
||||
return Activator.CreateInstance(paramType);
|
||||
}
|
||||
#endif
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -35,10 +35,8 @@ using System.Text;
|
||||
using System.Xml;
|
||||
using System.Reflection;
|
||||
using System.Net;
|
||||
#if !TARGET_JVM
|
||||
using System.CodeDom.Compiler;
|
||||
using Microsoft.CSharp;
|
||||
#endif
|
||||
|
||||
namespace System.Runtime.Remoting.MetadataServices
|
||||
{
|
||||
@ -56,7 +54,6 @@ namespace System.Runtime.Remoting.MetadataServices
|
||||
{
|
||||
}
|
||||
|
||||
#if !TARGET_JVM
|
||||
[MonoTODO ("strong name")]
|
||||
public static void ConvertCodeSourceFileToAssemblyFile (
|
||||
string codePath,
|
||||
@ -133,7 +130,6 @@ namespace System.Runtime.Remoting.MetadataServices
|
||||
memStream.Position = 0;
|
||||
cg.GenerateCode (clientProxy, outputDirectory, memStream, outCodeStreamList, proxyUrl, proxyNamespace);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static void ConvertTypesToSchemaToFile (ServiceType [] types, SdlType sdlType, string path)
|
||||
{
|
||||
|
@ -1,4 +0,0 @@
|
||||
System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.cs
|
||||
System.Runtime.Remoting.Channels.Ipc/*.cs
|
||||
System.Runtime.Remoting.Channels.Ipc.Unix/*.cs
|
||||
System.Runtime.Remoting.Channels.Ipc.Win32/*.cs
|
@ -1,3 +0,0 @@
|
||||
#include System.Runtime.Remoting.dll.sources
|
||||
|
||||
System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.jvm.cs
|
Reference in New Issue
Block a user