Ver código fonte

Merge pull request #2353 from ludovic-henry/fix-servicemodel-15153

Add test and merge #1879

@monojenkins merge
monojenkins 10 anos atrás
pai
commit
ac432e4ba2

+ 2 - 1
mcs/class/System.ServiceModel/System.ServiceModel/NetTcpBinding.cs

@@ -43,7 +43,8 @@ namespace System.ServiceModel
 		int max_conn;
 		OptionalReliableSession reliable_session;
 		NetTcpSecurity security;
-		XmlDictionaryReaderQuotas reader_quotas;
+		XmlDictionaryReaderQuotas reader_quotas
+			= new XmlDictionaryReaderQuotas ();
 		bool transaction_flow;
 		TransactionProtocol transaction_protocol;
 		TcpTransportBindingElement transport;

+ 7 - 0
mcs/class/System.ServiceModel/Test/System.ServiceModel/NetTcpBindingTest.cs

@@ -213,6 +213,13 @@ namespace MonoTests.System.ServiceModel
 			Assert.IsTrue (Foo.JoinCalled, "#2");
 		}
 
+		[Test]
+		public void ReaderQuotasDefault_Bug15153 ()
+		{
+			NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
+			binding.ReaderQuotas.MaxStringContentLength = 8192;
+		}
+
 		[ServiceContract]
 		public interface IFoo
 		{