summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2013-03-05 22:05:22 -0800
committerDon Kjer <don@lindenlab.com>2013-03-05 22:05:22 -0800
commit54cdc322b8f2bd35b289cacf3493622e7cc51194 (patch)
tree4f686cdfbaaf8819dfb1b015a1c8388ea1f59eac /indra/llmessage
parent9a0c52a247ecbd79f5f872ceb97a6be3e0499bea (diff)
Fixing issues with not detecting when LLSD XML parsing fails. Changing most http error handlers to understand LLSD error responses. Fleshing out most http error handler message spam.
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llavatarnamecache.cpp6
-rw-r--r--indra/llmessage/llcachename.cpp4
-rw-r--r--indra/llmessage/llcurl.cpp4
3 files changed, 10 insertions, 4 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index a6e2c89ba4..f9e3ad26f7 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -443,8 +443,10 @@ void LLAvatarNameCache::cleanupClass()
void LLAvatarNameCache::importFile(std::istream& istr)
{
LLSD data;
- S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr);
- if (parse_count < 1) return;
+ if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
+ {
+ return;
+ }
// by convention LLSD storage is a map
// we only store one entry in the map
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 8f4af1984c..d9eb65ff59 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -308,8 +308,10 @@ boost::signals2::connection LLCacheName::addObserver(const LLCacheNameCallback&
bool LLCacheName::importFile(std::istream& istr)
{
LLSD data;
- if(LLSDSerialize::fromXMLDocument(data, istr) < 1)
+ if(LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
+ {
return false;
+ }
// We'll expire entries more than a week old
U32 now = (U32)time(NULL);
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 8ffa8e4271..47041a2880 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -175,9 +175,11 @@ void LLCurl::Responder::completedRaw(
{
LLSD content;
LLBufferStream istr(channels, buffer.get());
- if (!LLSDSerialize::fromXML(content, istr))
+ const bool emit_errors = false;
+ if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(content, istr, emit_errors))
{
llinfos << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << llendl;
+ content["reason"] = reason;
}
completed(status, reason, content);