diff options
author | Justin Clark-Casey (justincc) | 2012-07-13 01:03:28 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-13 01:03:28 +0100 |
commit | 884d603cac6c3fe0cdbd199e13e1514146ff82bc (patch) | |
tree | 00701964cd4053700c5f37c48c8a5196928b00d1 /OpenSim/Server/Handlers/Inventory | |
parent | Don't cache regions data on the other unused LocalGridServiceConnector that t... (diff) | |
download | opensim-SC_OLD-884d603cac6c3fe0cdbd199e13e1514146ff82bc.zip opensim-SC_OLD-884d603cac6c3fe0cdbd199e13e1514146ff82bc.tar.gz opensim-SC_OLD-884d603cac6c3fe0cdbd199e13e1514146ff82bc.tar.bz2 opensim-SC_OLD-884d603cac6c3fe0cdbd199e13e1514146ff82bc.tar.xz |
Rather than instantiating a UTF8 encoding everywhere when we want to supress the BOM, use a single Util.UTF8NoBomEncoding.
This class is thread-safe (as evidenced by the provision of the system-wide Encoding.UTF8 which does not suppress BOM on output).
Diffstat (limited to 'OpenSim/Server/Handlers/Inventory')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index cb9b65d..64127c2 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -217,9 +217,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
217 | result["RESULT"] = "False"; | 217 | result["RESULT"] = "False"; |
218 | 218 | ||
219 | string xmlString = ServerUtils.BuildXmlResponse(result); | 219 | string xmlString = ServerUtils.BuildXmlResponse(result); |
220 | |||
220 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 221 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
221 | UTF8Encoding encoding = new UTF8Encoding(); | 222 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
222 | return encoding.GetBytes(xmlString); | ||
223 | } | 223 | } |
224 | 224 | ||
225 | byte[] HandleGetInventorySkeleton(Dictionary<string,object> request) | 225 | byte[] HandleGetInventorySkeleton(Dictionary<string,object> request) |
@@ -245,9 +245,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
245 | result["FOLDERS"] = sfolders; | 245 | result["FOLDERS"] = sfolders; |
246 | 246 | ||
247 | string xmlString = ServerUtils.BuildXmlResponse(result); | 247 | string xmlString = ServerUtils.BuildXmlResponse(result); |
248 | |||
248 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 249 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
249 | UTF8Encoding encoding = new UTF8Encoding(); | 250 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
250 | return encoding.GetBytes(xmlString); | ||
251 | } | 251 | } |
252 | 252 | ||
253 | byte[] HandleGetUserInventory(Dictionary<string, object> request) | 253 | byte[] HandleGetUserInventory(Dictionary<string, object> request) |
@@ -284,9 +284,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
284 | } | 284 | } |
285 | 285 | ||
286 | string xmlString = ServerUtils.BuildXmlResponse(result); | 286 | string xmlString = ServerUtils.BuildXmlResponse(result); |
287 | |||
287 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 288 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
288 | UTF8Encoding encoding = new UTF8Encoding(); | 289 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
289 | return encoding.GetBytes(xmlString); | ||
290 | } | 290 | } |
291 | 291 | ||
292 | byte[] HandleGetRootFolder(Dictionary<string,object> request) | 292 | byte[] HandleGetRootFolder(Dictionary<string,object> request) |
@@ -300,9 +300,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
300 | result["folder"] = EncodeFolder(rfolder); | 300 | result["folder"] = EncodeFolder(rfolder); |
301 | 301 | ||
302 | string xmlString = ServerUtils.BuildXmlResponse(result); | 302 | string xmlString = ServerUtils.BuildXmlResponse(result); |
303 | |||
303 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 304 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
304 | UTF8Encoding encoding = new UTF8Encoding(); | 305 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
305 | return encoding.GetBytes(xmlString); | ||
306 | } | 306 | } |
307 | 307 | ||
308 | byte[] HandleGetFolderForType(Dictionary<string,object> request) | 308 | byte[] HandleGetFolderForType(Dictionary<string,object> request) |
@@ -317,9 +317,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
317 | result["folder"] = EncodeFolder(folder); | 317 | result["folder"] = EncodeFolder(folder); |
318 | 318 | ||
319 | string xmlString = ServerUtils.BuildXmlResponse(result); | 319 | string xmlString = ServerUtils.BuildXmlResponse(result); |
320 | |||
320 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 321 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
321 | UTF8Encoding encoding = new UTF8Encoding(); | 322 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
322 | return encoding.GetBytes(xmlString); | ||
323 | } | 323 | } |
324 | 324 | ||
325 | byte[] HandleGetFolderContent(Dictionary<string,object> request) | 325 | byte[] HandleGetFolderContent(Dictionary<string,object> request) |
@@ -358,9 +358,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
358 | } | 358 | } |
359 | 359 | ||
360 | string xmlString = ServerUtils.BuildXmlResponse(result); | 360 | string xmlString = ServerUtils.BuildXmlResponse(result); |
361 | |||
361 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 362 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
362 | UTF8Encoding encoding = new UTF8Encoding(); | 363 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
363 | return encoding.GetBytes(xmlString); | ||
364 | } | 364 | } |
365 | 365 | ||
366 | byte[] HandleGetFolderItems(Dictionary<string,object> request) | 366 | byte[] HandleGetFolderItems(Dictionary<string,object> request) |
@@ -386,9 +386,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
386 | result["ITEMS"] = sitems; | 386 | result["ITEMS"] = sitems; |
387 | 387 | ||
388 | string xmlString = ServerUtils.BuildXmlResponse(result); | 388 | string xmlString = ServerUtils.BuildXmlResponse(result); |
389 | |||
389 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 390 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
390 | UTF8Encoding encoding = new UTF8Encoding(); | 391 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
391 | return encoding.GetBytes(xmlString); | ||
392 | } | 392 | } |
393 | 393 | ||
394 | byte[] HandleAddFolder(Dictionary<string,object> request) | 394 | byte[] HandleAddFolder(Dictionary<string,object> request) |
@@ -550,9 +550,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
550 | result["item"] = EncodeItem(item); | 550 | result["item"] = EncodeItem(item); |
551 | 551 | ||
552 | string xmlString = ServerUtils.BuildXmlResponse(result); | 552 | string xmlString = ServerUtils.BuildXmlResponse(result); |
553 | |||
553 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 554 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
554 | UTF8Encoding encoding = new UTF8Encoding(); | 555 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
555 | return encoding.GetBytes(xmlString); | ||
556 | } | 556 | } |
557 | 557 | ||
558 | byte[] HandleGetFolder(Dictionary<string,object> request) | 558 | byte[] HandleGetFolder(Dictionary<string,object> request) |
@@ -567,9 +567,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
567 | result["folder"] = EncodeFolder(folder); | 567 | result["folder"] = EncodeFolder(folder); |
568 | 568 | ||
569 | string xmlString = ServerUtils.BuildXmlResponse(result); | 569 | string xmlString = ServerUtils.BuildXmlResponse(result); |
570 | |||
570 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 571 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
571 | UTF8Encoding encoding = new UTF8Encoding(); | 572 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
572 | return encoding.GetBytes(xmlString); | ||
573 | } | 573 | } |
574 | 574 | ||
575 | byte[] HandleGetActiveGestures(Dictionary<string,object> request) | 575 | byte[] HandleGetActiveGestures(Dictionary<string,object> request) |
@@ -592,9 +592,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
592 | result["ITEMS"] = items; | 592 | result["ITEMS"] = items; |
593 | 593 | ||
594 | string xmlString = ServerUtils.BuildXmlResponse(result); | 594 | string xmlString = ServerUtils.BuildXmlResponse(result); |
595 | |||
595 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 596 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
596 | UTF8Encoding encoding = new UTF8Encoding(); | 597 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
597 | return encoding.GetBytes(xmlString); | ||
598 | } | 598 | } |
599 | 599 | ||
600 | byte[] HandleGetAssetPermissions(Dictionary<string,object> request) | 600 | byte[] HandleGetAssetPermissions(Dictionary<string,object> request) |
@@ -609,12 +609,11 @@ namespace OpenSim.Server.Handlers.Asset | |||
609 | 609 | ||
610 | result["RESULT"] = perms.ToString(); | 610 | result["RESULT"] = perms.ToString(); |
611 | string xmlString = ServerUtils.BuildXmlResponse(result); | 611 | string xmlString = ServerUtils.BuildXmlResponse(result); |
612 | |||
612 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 613 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
613 | UTF8Encoding encoding = new UTF8Encoding(); | 614 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
614 | return encoding.GetBytes(xmlString); | ||
615 | } | 615 | } |
616 | 616 | ||
617 | |||
618 | private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) | 617 | private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) |
619 | { | 618 | { |
620 | Dictionary<string, object> ret = new Dictionary<string, object>(); | 619 | Dictionary<string, object> ret = new Dictionary<string, object>(); |