mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
Where possible, use the system Encoding.ASCII and Encoding.UTF8 rather than constructing fresh copies.
The encodings are thread-safe and already used in such a manner in other places. This isn't done where Byte Order Mark output is suppressed, since Encoding.UTF8 is constructed to output the BOM.
This commit is contained in:
@@ -1120,7 +1120,6 @@ namespace Nwc.XmlRpc
|
||||
/// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
|
||||
public class ConfigurableKeepAliveXmlRpcRequest : XmlRpcRequest
|
||||
{
|
||||
private Encoding _encoding = new ASCIIEncoding();
|
||||
private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
|
||||
private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
|
||||
private bool _disableKeepAlive = true;
|
||||
@@ -1153,7 +1152,7 @@ namespace Nwc.XmlRpc
|
||||
request.KeepAlive = !_disableKeepAlive;
|
||||
|
||||
Stream stream = request.GetRequestStream();
|
||||
XmlTextWriter xml = new XmlTextWriter(stream, _encoding);
|
||||
XmlTextWriter xml = new XmlTextWriter(stream, Encoding.ASCII);
|
||||
_serializer.Serialize(xml, this);
|
||||
xml.Flush();
|
||||
xml.Close();
|
||||
|
||||
Reference in New Issue
Block a user