* Fixed a bug in BitPack where existing 1 bits were not being overwritten by new 0 bits

* Added BitPack.PackBit()
* Made Binary LLSD deserialization more lenient when parsing the header. Tests pass again

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3364 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2010-06-25 01:24:11 +00:00
parent e1417f2101
commit f108207698
4 changed files with 41 additions and 5 deletions

View File

@@ -53,7 +53,8 @@ namespace OpenMetaverse.StructuredData
private const int int32Length = 4;
private const int doubleLength = 8;
private const string llsdBinaryHead = "<? llsd/binary ?>\n";
private const string llsdBinaryHead = "<? llsd/binary ?>";
private const string llsdBinaryHead2 = "<?llsd/binary?>";
private const byte undefBinaryValue = (byte)'!';
private const byte trueBinaryValue = (byte)'1';
private const byte falseBinaryValue = (byte)'0';
@@ -98,10 +99,11 @@ namespace OpenMetaverse.StructuredData
SkipWhiteSpace(stream);
bool result = FindString(stream, llsdBinaryHead);
if (!result)
if (!FindString(stream, llsdBinaryHead) && !FindString(stream, llsdBinaryHead2))
throw new OSDException("Failed to decode binary LLSD");
SkipWhiteSpace(stream);
return ParseLLSDBinaryElement(stream);
}