MAINT-8364 Fix for requestAvatarNameCache_ crash

Wed, 07 Mar 2018 20:31:29 +0200

author
andreykproductengine <andreykproductengine@lindenlab.com>
date
Wed, 07 Mar 2018 20:31:29 +0200
changeset 55330
d28612dea27b
parent 55329
005206c5c001
child 55331
be6bd8f683ff

MAINT-8364 Fix for requestAvatarNameCache_ crash

indra/llmessage/llavatarnamecache.cpp file | annotate | diff | revisions
     1.1 --- a/indra/llmessage/llavatarnamecache.cpp	Wed Mar 07 17:26:51 2018 +0200
     1.2 +++ b/indra/llmessage/llavatarnamecache.cpp	Wed Mar 07 20:31:29 2018 +0200
     1.3 @@ -192,13 +192,21 @@
     1.4      LL_DEBUGS("AvNameCache") << "Entering coroutine " << LLCoros::instance().getName()
     1.5          << " with url '" << url << "', requesting " << agentIds.size() << " Agent Ids" << LL_ENDL;
     1.6  
     1.7 +    // Check pointer that can be cleaned up by cleanupClass()
     1.8 +    if (!sHttpRequest || !sHttpOptions || !sHttpHeaders)
     1.9 +    {
    1.10 +        LL_WARNS("AvNameCache") << " Trying to request name cache when http pointers are not initialized." << LL_ENDL;
    1.11 +        return;
    1.12 +    }
    1.13 +
    1.14 +    LLSD httpResults;
    1.15 +
    1.16      try
    1.17      {
    1.18          bool success = true;
    1.19  
    1.20          LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("NameCache", LLAvatarNameCache::sHttpPolicy);
    1.21          LLSD results = httpAdapter.getAndSuspend(sHttpRequest, url);
    1.22 -        LLSD httpResults;
    1.23  
    1.24          LL_DEBUGS() << results << LL_ENDL;
    1.25  
    1.26 @@ -237,6 +245,7 @@
    1.27      {
    1.28          LOG_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << LLCoros::instance().getName()
    1.29                                            << "('" << url << "', " << agentIds.size()
    1.30 +                                          << " http result: " << httpResults.asString()
    1.31                                            << " Agent Ids)"));
    1.32          throw;
    1.33      }
    1.34 @@ -326,6 +335,11 @@
    1.35  
    1.36  void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& av_name)
    1.37  {
    1.38 +	if (agent_id.isNull())
    1.39 +	{
    1.40 +		return;
    1.41 +	}
    1.42 +
    1.43  	// Add to the cache
    1.44  	sCache[agent_id] = av_name;
    1.45  

mercurial