replace llsd xml fw encoder

This commit is contained in:
UbitUmarov
2020-10-13 16:20:55 +01:00
parent 1fc6f84790
commit c70904418a
9 changed files with 170 additions and 181 deletions

View File

@@ -468,12 +468,7 @@ namespace OpenSim.Region.ClientStack.Linden
// do nothing, in last case http server will do it
}
private readonly byte[] EventHeader = GenEventHeader();
private static byte[] GenEventHeader()
{
return Encoding.UTF8.GetBytes("<llsd><map><key>events</key><array>");
}
private readonly byte[] EventHeader = osUTF8.GetASCIIBytes("<llsd><map><key>events</key><array>");
public Hashtable GetEvents(UUID requestID, UUID pAgentId)
{
@@ -539,11 +534,11 @@ namespace OpenSim.Region.ClientStack.Linden
totalSize += EventHeader.Length;
StringBuilder sb = new StringBuilder(1024);
LLSDxmlEncode.AddEndArray(sb); // events array
LLSDxmlEncode.AddElem("id", thisID, sb);
LLSDxmlEncode.AddEndMap(sb);
element = LLSDxmlEncode.EndToNBBytes(sb);
osUTF8 sb = OSUTF8Cached.Acquire();
LLSDxmlEncode2.AddEndArray(sb); // events array
LLSDxmlEncode2.AddElem("id", thisID, sb);
LLSDxmlEncode2.AddEndMap(sb);
element = LLSDxmlEncode2.EndToBytes(sb);
elements.Add(element);
totalSize += element.Length;