ソースを参照

* BinaryClientFormatterSinkProvider.cs, BinaryServerFormatterSinkProvider.cs:
SoapClientFormatterSinkProvider.cs, SoapServerFormatterSinkProvider.cs: Small fix.
* SoapServerFormatterSink.cs: Small fix in AsyncProcessResponse.
* BinaryCore.cs, SoapCore.cs: throw an exception if an unknown property
is found.

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

Lluis Sanchez 22 年 前
コミット
74e00dbeca

+ 1 - 1
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryClientFormatterSinkProvider.cs

@@ -24,7 +24,7 @@ namespace System.Runtime.Remoting.Channels
 		public BinaryClientFormatterSinkProvider (IDictionary properties,
 							  ICollection providerData)
 		{
-			_binaryCore = new BinaryCore (properties);
+			_binaryCore = new BinaryCore (this, properties);
 		}
 
 		public IClientChannelSinkProvider Next

+ 17 - 6
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs

@@ -21,16 +21,27 @@ namespace System.Runtime.Remoting.Channels
 		
 		public static BinaryCore DefaultInstance = new BinaryCore (true, false);
 		
-		public BinaryCore (IDictionary properties)
+		public BinaryCore (object owner, IDictionary properties)
 		{
 			bool includeVersions = true;
 			bool strictBinding = false;
 			
-			object val = properties ["includeVersions"];
-			if (val != null) includeVersions = Convert.ToBoolean (val);
-			
-			val = properties ["strictBinding"];
-			if (val != null) strictBinding = Convert.ToBoolean (val);
+			foreach(DictionaryEntry property in properties)
+			{
+				switch((string)property.Key)
+				{
+					case "includeVersions": 
+						includeVersions = Convert.ToBoolean (property.Value);
+						break;
+						
+					case "strictBinding":
+						strictBinding = Convert.ToBoolean (property.Value);
+						break;
+						
+					default:
+						throw new RemotingException (owner.GetType().Name + " does not recognize '" + property.Key + "' configuration property");
+				}
+			}
 			
 			Init (includeVersions, strictBinding);
 		}

+ 1 - 1
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryServerFormatterSinkProvider.cs

@@ -24,7 +24,7 @@ namespace System.Runtime.Remoting.Channels
 		public BinaryServerFormatterSinkProvider (IDictionary properties,
 							  ICollection providerData)
 		{
-			_binaryCore = new BinaryCore (properties);
+			_binaryCore = new BinaryCore (this, properties);
 		}
 
 		public IServerChannelSinkProvider Next

+ 8 - 0
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog

@@ -1,3 +1,11 @@
+2003-11-17  Lluis Sanchez Gual  <[email protected]>
+
+	* BinaryClientFormatterSinkProvider.cs, BinaryServerFormatterSinkProvider.cs:
+	  SoapClientFormatterSinkProvider.cs, SoapServerFormatterSinkProvider.cs: Small fix.
+	* SoapServerFormatterSink.cs: Small fix in AsyncProcessResponse.
+	* BinaryCore.cs, SoapCore.cs: throw an exception if an unknown property
+	  is found.
+	
 2003-11-16  Lluis Sanchez Gual  <[email protected]>
 
 	* BinaryClientFormatterSink.cs, BinaryClientFormatterSinkProvider.cs,

+ 1 - 1
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapClientFormatterSinkProvider.cs

@@ -18,7 +18,7 @@ namespace System.Runtime.Remoting.Channels {
 		public SoapClientFormatterSinkProvider(IDictionary properties,
 		                                       ICollection providerData)
 		{
-			_soapCore = new SoapCore (properties);
+			_soapCore = new SoapCore (this, properties);
 		}
 		
 		public virtual IClientChannelSinkProvider Next 

+ 17 - 6
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs

@@ -23,16 +23,27 @@ namespace System.Runtime.Remoting.Channels
 		
 		public static SoapCore DefaultInstance = new SoapCore (true, false);
 		
-		public SoapCore (IDictionary properties)
+		public SoapCore (object owner, IDictionary properties)
 		{
 			_includeVersions = true;
 			_strictBinding = false;
 			
-			object val = properties ["includeVersions"];
-			if (val != null) _includeVersions = Convert.ToBoolean (val);
-			
-			val = properties ["strictBinding"];
-			if (val != null) _strictBinding = Convert.ToBoolean (val);
+			foreach(DictionaryEntry property in properties)
+			{
+				switch((string)property.Key)
+				{
+					case "includeVersions": 
+						_includeVersions = Convert.ToBoolean (property.Value);
+						break;
+						
+					case "strictBinding":
+						_strictBinding = Convert.ToBoolean (property.Value);
+						break;
+						
+					default:
+						throw new RemotingException (owner.GetType().Name + " does not recognize '" + property.Key + "' configuration property");
+				}
+			}
 			
 			Init ();
 		}

+ 1 - 0
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs

@@ -80,6 +80,7 @@ namespace System.Runtime.Remoting.Channels {
 			_soapCore.Serializer.Serialize(stream, soapMessage, null);
 
 			if(stream is MemoryStream) stream.Position = 0;
+			sinkStack.AsyncProcessResponse (msg, responseHeaders, stream);
 		}
 
 		public Stream GetResponseStream (IServerResponseChannelSinkStack sinkStack, object state,

+ 1 - 1
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSinkProvider.cs

@@ -24,7 +24,7 @@ namespace System.Runtime.Remoting.Channels
 		public SoapServerFormatterSinkProvider (IDictionary properties,
 							ICollection providerData)
 		{
-			_soapCore = new SoapCore (properties);
+			_soapCore = new SoapCore (this, properties);
 		}
 
 		public IServerChannelSinkProvider Next