Преглед изворни кода

* RemotingProxy.cs: Assign to the message the full uri, if available,
not only the object uri.

svn path=/trunk/mcs/; revision=16305

Lluis Sanchez пре 22 година
родитељ
комит
b2ef45acd9

+ 5 - 0
mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog

@@ -1,3 +1,8 @@
+2003-07-16  Lluis Sanchez Gual <[email protected]>
+
+	* RemotingProxy.cs: Assign to the message the full uri, if available,
+	  not only the object uri.
+
 2003-04-10  Lluis Sanchez Gual <[email protected]>
 
 	* RemotingProxy.cs: Added support for Async and OneWay messages.

+ 13 - 6
mcs/class/corlib/System.Runtime.Remoting.Proxies/RemotingProxy.cs

@@ -23,17 +23,19 @@ namespace System.Runtime.Remoting.Proxies
 
 	public class RemotingProxy : RealProxy 
 	{
-		static MethodInfo _cache_GetTypeMethod = typeof(System.Object).GetMethod("GetType");
-		static MethodInfo _cache_GetHashCodeMethod = typeof(System.Object).GetMethod("GetHashCode");
-
+		static MethodInfo _cache_GetTypeMethod = typeof(System.Object).GetMethod("GetType");
+		static MethodInfo _cache_GetHashCodeMethod = typeof(System.Object).GetMethod("GetHashCode");
+
 		IMessageSink _sink;
 		bool _hasEnvoySink;
 		ConstructionCall _ctorCall;
+		string _targetUri;
 
 		internal RemotingProxy (Type type, ClientIdentity identity) : base (type, identity)
 		{
 			_sink = identity.ChannelSink;
 			_hasEnvoySink = false;
+			_targetUri = identity.TargetUri;
 		}
 
 		internal RemotingProxy (Type type, string activationUrl, object[] activationAttributes) : base (type)
@@ -50,12 +52,12 @@ namespace System.Runtime.Remoting.Proxies
 				return ActivateRemoteObject (mMsg);
 
 			if (mMsg.MethodBase == _cache_GetHashCodeMethod)
-				return new MethodResponse(ObjectIdentity.GetHashCode(), null, null, request as IMethodCallMessage);
+				return new MethodResponse(ObjectIdentity.GetHashCode(), null, null, request as IMethodCallMessage);
 
 			if (mMsg.MethodBase == _cache_GetTypeMethod)
-				return new MethodResponse(GetProxiedType(), null, null, request as IMethodCallMessage);
+				return new MethodResponse(GetProxiedType(), null, null, request as IMethodCallMessage);
 
-			mMsg.Uri = _objectIdentity.ObjectUri;
+			mMsg.Uri = _targetUri;
 			((IInternalMessage)mMsg).TargetIdentity = _objectIdentity;
 
 			_objectIdentity.NotifyClientDynamicSinks (true, request, true, false);
@@ -96,7 +98,12 @@ namespace System.Runtime.Remoting.Proxies
 			}
 
 			if (identity is ClientIdentity)
+			{
 				((ClientIdentity)identity).ClientProxy = (MarshalByRefObject) GetTransparentProxy();
+				_targetUri = ((ClientIdentity)identity).TargetUri;
+			}
+			else
+				_targetUri = identity.ObjectUri;
 
 			if (_objectIdentity.EnvoySink != null) 
 			{