summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-04-26 14:19:58 -0700
committerJames Cook <james@lindenlab.com>2010-04-26 14:19:58 -0700
commite4f2887983dc6f473c6657b8b653437557c638fa (patch)
treecc74079f6a530e94215d07221b643b8fac3a7c6d
parent7c913b91163cb2cb9e1829b523d1678a74230e93 (diff)
Don't save dummy records (from 503 errors) to disk cache
-rw-r--r--indra/llcommon/llavatarname.cpp1
-rw-r--r--indra/llcommon/llavatarname.h5
-rw-r--r--indra/llmessage/llavatarnamecache.cpp8
3 files changed, 12 insertions, 2 deletions
diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp
index c35b8380b8..4272e096ed 100644
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llcommon/llavatarname.cpp
@@ -49,6 +49,7 @@ LLAvatarName::LLAvatarName()
: mSLID(),
mDisplayName(),
mIsDisplayNameDefault(false),
+ mIsDummy(false),
mExpires(F64_MAX),
mBadge()
{ }
diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index b30dca6e6e..3e26887d7a 100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -61,6 +61,11 @@ public:
// a legacy first and last name, like "James Linden (james.linden)"
bool mIsDisplayNameDefault;
+ // Under error conditions, we may insert "dummy" records with
+ // names like "???" into caches as placeholders. These can be
+ // shown in UI, but are not serialized.
+ bool mIsDummy;
+
// Names can change, so need to keep track of when name was
// last checked.
// Unix time-from-epoch seconds for efficiency
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index eabd311bb0..5acecd1dcb 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -184,6 +184,7 @@ public:
av_name.mSLID = DUMMY_NAME;
av_name.mDisplayName = DUMMY_NAME;
av_name.mIsDisplayNameDefault = false;
+ av_name.mIsDummy = true;
av_name.mExpires = retry_timestamp;
// Add dummy records for all agent IDs in this request
@@ -358,8 +359,11 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr)
{
const LLUUID& agent_id = it->first;
const LLAvatarName& av_name = it->second;
- // key must be a string
- agents[agent_id.asString()] = av_name.asLLSD();
+ if (!av_name.mIsDummy)
+ {
+ // key must be a string
+ agents[agent_id.asString()] = av_name.asLLSD();
+ }
}
LLSD data;
data["agents"] = agents;