summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsdserialize.cpp
diff options
context:
space:
mode:
authorDave Simmons <simon@lindenlab.com>2008-06-25 16:22:00 +0000
committerDave Simmons <simon@lindenlab.com>2008-06-25 16:22:00 +0000
commit580f9088b4644c1d9e41a25deac42dc487e9d5c1 (patch)
treeeed42644b0593ba613a809f806b6f03c8910377e /indra/llcommon/llsdserialize.cpp
parent12284eee5a508cd80382352c9f6aeb455297a310 (diff)
svn merge -r90394:90492 svn/branches/havok4/qar-689 --> release
QAR-689 - branch/havok4/havok4-7 r89805 is ready for merge back into release
Diffstat (limited to 'indra/llcommon/llsdserialize.cpp')
-rw-r--r--indra/llcommon/llsdserialize.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 2183792bb1..6bb75439a2 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -146,12 +146,15 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
* Create the parser as appropriate
*/
if (legacy_no_header)
- {
- LLSDXMLParser* x = new LLSDXMLParser;
- x->parsePart(hdr_buf, inbuf);
- p = x;
+ { // Create a LLSD XML parser, and parse the first chunk read above
+ LLSDXMLParser* x = new LLSDXMLParser();
+ x->parsePart(hdr_buf, inbuf); // Parse the first part that was already read
+ x->parseLines(str, sd); // Parse the rest of it
+ delete x;
+ return true;
}
- else if (header == LLSD_BINARY_HEADER)
+
+ if (header == LLSD_BINARY_HEADER)
{
p = new LLSDBinaryParser;
}
@@ -300,7 +303,8 @@ static const char BINARY_FALSE_SERIAL = '0';
/**
* LLSDParser
*/
-LLSDParser::LLSDParser() : mCheckLimits(true), mMaxBytesLeft(0)
+LLSDParser::LLSDParser()
+ : mCheckLimits(true), mMaxBytesLeft(0), mParseLines(false)
{
}
@@ -316,6 +320,15 @@ S32 LLSDParser::parse(std::istream& istr, LLSD& data, S32 max_bytes)
}
+// Parse using routine to get() lines, faster than parse()
+S32 LLSDParser::parseLines(std::istream& istr, LLSD& data)
+{
+ mCheckLimits = false;
+ mParseLines = true;
+ return doParse(istr, data);
+}
+
+
int LLSDParser::get(std::istream& istr) const
{
if(mCheckLimits) --mMaxBytesLeft;