From b069b668e43284a0c3867e96f3a266f44e36450d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 29 Apr 2020 12:34:48 +0100 Subject: [PATCH] make some use of those --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 16 ++++++------- .../Caps/BunchOfCaps/UpdateItemAsset.cs | 24 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 71b0c48d32..57ac19db86 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -424,7 +424,7 @@ namespace OpenSim.Region.ClientStack.Linden } string result = LLSDHelpers.SerialiseLLSDReply(m_HostCapsObj.GetCapsDetails(true, validCaps)); - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(result); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(result); httpResponse.StatusCode = (int)HttpStatusCode.OK; //m_log.DebugFormat("[CAPS] CapsRequest {0}", result); } @@ -1266,7 +1266,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDxmlEncode.AddElem("type", folder.Type, sb); LLSDxmlEncode.AddEndMap(sb); - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(LLSDxmlEncode.End(sb)); + httpResponse.RawBuffer = LLSDxmlEncode.EndToNBBytes(sb); httpResponse.StatusCode = (int)HttpStatusCode.OK; return; } @@ -1514,7 +1514,7 @@ namespace OpenSim.Region.ClientStack.Linden } } - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(LLSDxmlEncode.End(lsl)); + httpResponse.RawBuffer = LLSDxmlEncode.EndToNBBytes(lsl); httpResponse.StatusCode = (int)HttpStatusCode.OK; } @@ -1581,7 +1581,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDxmlEncode.AddEndMap(lsl); } - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(LLSDxmlEncode.End(lsl)); + httpResponse.RawBuffer = LLSDxmlEncode.EndToNBBytes(lsl); httpResponse.StatusCode = (int)HttpStatusCode.OK; } @@ -1649,7 +1649,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDxmlEncode.AddEndMap(lsl); // resp["transaction_id"] = "undef"; - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(LLSDxmlEncode.End(lsl)); + httpResponse.RawBuffer = LLSDxmlEncode.EndToNBBytes(lsl); httpResponse.StatusCode = (int)HttpStatusCode.OK; } @@ -1825,7 +1825,7 @@ namespace OpenSim.Region.ClientStack.Linden resp["HomeLocation"] = homeloc; } - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(resp)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(OSDParser.SerializeLLSDXmlString(resp)); httpResponse.StatusCode = (int)HttpStatusCode.OK; } @@ -1964,7 +1964,7 @@ namespace OpenSim.Region.ClientStack.Linden resp["members"] = new OSDMap(); } - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(resp)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(OSDParser.SerializeLLSDXmlString(resp)); httpResponse.StatusCode = (int)HttpStatusCode.OK; } @@ -2038,7 +2038,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDxmlEncode.AddEndMap(lsl); - httpResponse.RawBuffer = Encoding.UTF8.GetBytes(LLSDxmlEncode.End(lsl)); + httpResponse.RawBuffer = LLSDxmlEncode.EndToNBBytes(lsl); httpResponse.ContentType = "application/llsd+xml"; httpResponse.StatusCode = (int)HttpStatusCode.OK; } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs index bc3dc73121..3052a8c8c0 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "failed to recode request"; error.identifier = UUID.Zero; - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } @@ -82,7 +82,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "object not found"; error.identifier = UUID.Zero; - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } @@ -91,7 +91,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "No permissions to edit objec"; error.identifier = UUID.Zero; - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } } @@ -118,7 +118,7 @@ namespace OpenSim.Region.ClientStack.Linden // m_log.InfoFormat("[CAPS]: UpdateAgentInventoryAsset response: {0}", // LLSDHelpers.SerialiseLLSDReply(uploadResponse))); - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(uploadResponse)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(uploadResponse)); } /// @@ -171,7 +171,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "failed to recode request"; error.identifier = UUID.Zero; - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } @@ -181,7 +181,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "object not found"; error.identifier = UUID.Zero; - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } @@ -190,7 +190,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "No permissions to edit objec"; error.identifier = UUID.Zero; - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } @@ -199,7 +199,7 @@ namespace OpenSim.Region.ClientStack.Linden LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "No permissions to edit script"; error.identifier = UUID.Zero; - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } @@ -225,7 +225,7 @@ namespace OpenSim.Region.ClientStack.Linden // "ScriptTaskInventory response: {0}", // LLSDHelpers.SerialiseLLSDReply(uploadResponse))); - httpResponse.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(uploadResponse)); + httpResponse.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(uploadResponse)); } catch (Exception e) { @@ -353,7 +353,7 @@ namespace OpenSim.Region.ClientStack.Linden } response.StatusCode = (int)HttpStatusCode.OK; - response.RawBuffer = Encoding.UTF8.GetBytes(res); + response.RawBuffer = Util.UTF8NBGetbytes(res); } } @@ -447,14 +447,14 @@ namespace OpenSim.Region.ClientStack.Linden } // m_log.InfoFormat("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); - response.RawBuffer = Encoding.UTF8.GetBytes(res); + response.RawBuffer = Util.UTF8NBGetbytes(res); } catch { LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "could not compile script"; error.identifier = UUID.Zero; - response.RawBuffer = Util.UTF8.GetBytes(LLSDHelpers.SerialiseLLSDReply(error)); + response.RawBuffer = Util.UTF8NBGetbytes(LLSDHelpers.SerialiseLLSDReply(error)); return; } }