diff options
author | Martin Baulig <martin.baulig@xamarin.com> | 2013-03-22 04:55:53 +0400 |
---|---|---|
committer | Martin Baulig <martin.baulig@xamarin.com> | 2013-03-22 04:57:37 +0400 |
commit | d2d903f1d2c74c54b20f68865b862f7e1e17d68a (patch) | |
tree | 8d4d4bf3ee5a00ef1410fda20c860d3466dcdbcd /mcs | |
parent | e7110819846f6d0c0b8a5d53777bbfd5c81040e0 (diff) |
[WCF]: 2nd part of bug #5827, set CheckCharacters = false in TextMessageEncoder.
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System.ServiceModel/System.ServiceModel.Channels/TextMessageEncoder.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Channels/TextMessageEncoder.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Channels/TextMessageEncoder.cs index 0ff234382a2..89d971656ff 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Channels/TextMessageEncoder.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Channels/TextMessageEncoder.cs @@ -66,12 +66,14 @@ namespace System.ServiceModel.Channels { if (bufferManager == null) throw new ArgumentNullException ("bufferManager"); + var settings = new XmlReaderSettings (); + settings.CheckCharacters = false; var ret = Message.CreateMessage ( XmlDictionaryReader.CreateDictionaryReader ( XmlReader.Create (new StreamReader ( new MemoryStream ( buffer.Array, buffer.Offset, - buffer.Count), encoding))), + buffer.Count), encoding), settings)), // FIXME: supply max header size int.MaxValue, version); @@ -84,9 +86,11 @@ namespace System.ServiceModel.Channels { if (stream == null) throw new ArgumentNullException ("stream"); + var settings = new XmlReaderSettings (); + settings.CheckCharacters = false; var ret = Message.CreateMessage ( XmlDictionaryReader.CreateDictionaryReader ( - XmlReader.Create (new StreamReader (stream, encoding))), + XmlReader.Create (new StreamReader (stream, encoding), settings)), maxSizeOfHeaders, version); ret.Properties.Encoder = this; @@ -113,6 +117,7 @@ namespace System.ServiceModel.Channels XmlWriterSettings s = new XmlWriterSettings (); s.Encoding = encoding; + s.CheckCharacters = false; using (XmlWriter w = XmlWriter.Create (stream, s)) { message.WriteMessage ( XmlDictionaryWriter.CreateDictionaryWriter (w)); @@ -131,6 +136,7 @@ namespace System.ServiceModel.Channels messageOffset, maxMessageSize); XmlWriterSettings s = new XmlWriterSettings (); s.Encoding = encoding; + s.CheckCharacters = false; using (XmlWriter w = XmlWriter.Create ( new MemoryStream (seg.Array, seg.Offset, seg.Count), s)) { message.WriteMessage ( |