diff options
author | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
commit | 916e3bf886ee622e2f18d6eb74f90fee8c630471 (patch) | |
tree | 69f9a6d2a7f7041966400f56f46c198f2cc06158 /OpenSim/Region/OptionalModules/Avatar | |
parent | Fix build break for windows with missing package for IScriptEngine in prebuil... (diff) | |
download | opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.zip opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.gz opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.bz2 opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index be8873d..7fafdc6 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -823,11 +823,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
823 | m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", | 823 | m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", |
824 | landName, land.LocalID, landUUID); | 824 | landName, land.LocalID, landUUID); |
825 | } | 825 | } |
826 | System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); | ||
827 | 826 | ||
828 | // slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables | 827 | // slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables |
829 | // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator. | 828 | // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator. |
830 | channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm); | 829 | channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(Encoding.ASCII.GetBytes(landUUID)), m_freeSwitchRealm); |
831 | 830 | ||
832 | lock (m_ParcelAddress) | 831 | lock (m_ParcelAddress) |
833 | { | 832 | { |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 52fc27d..61aaf04 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -1120,7 +1120,6 @@ namespace Nwc.XmlRpc | |||
1120 | /// <summary>Class supporting the request side of an XML-RPC transaction.</summary> | 1120 | /// <summary>Class supporting the request side of an XML-RPC transaction.</summary> |
1121 | public class ConfigurableKeepAliveXmlRpcRequest : XmlRpcRequest | 1121 | public class ConfigurableKeepAliveXmlRpcRequest : XmlRpcRequest |
1122 | { | 1122 | { |
1123 | private Encoding _encoding = new ASCIIEncoding(); | ||
1124 | private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer(); | 1123 | private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer(); |
1125 | private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer(); | 1124 | private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer(); |
1126 | private bool _disableKeepAlive = true; | 1125 | private bool _disableKeepAlive = true; |
@@ -1153,7 +1152,7 @@ namespace Nwc.XmlRpc | |||
1153 | request.KeepAlive = !_disableKeepAlive; | 1152 | request.KeepAlive = !_disableKeepAlive; |
1154 | 1153 | ||
1155 | Stream stream = request.GetRequestStream(); | 1154 | Stream stream = request.GetRequestStream(); |
1156 | XmlTextWriter xml = new XmlTextWriter(stream, _encoding); | 1155 | XmlTextWriter xml = new XmlTextWriter(stream, Encoding.ASCII); |
1157 | _serializer.Serialize(xml, this); | 1156 | _serializer.Serialize(xml, this); |
1158 | xml.Flush(); | 1157 | xml.Flush(); |
1159 | xml.Close(); | 1158 | xml.Close(); |