summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llassetstorage.cpp23
-rw-r--r--indra/llmessage/llavatarnamecache.cpp14
-rw-r--r--indra/llmessage/llcurl.cpp8
3 files changed, 28 insertions, 17 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 27a368df3d..69d092de76 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -398,6 +398,12 @@ BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType
bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type,
LLGetAssetCallback callback, void *user_data)
{
+ if (user_data)
+ {
+ // The *user_data should not be passed without a callback to clean it up.
+ llassert(callback != NULL)
+ }
+
BOOL exists = mStaticVFS->getExists(uuid, type);
if (exists)
{
@@ -432,15 +438,26 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
llinfos << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl;
+ if (user_data)
+ {
+ // The *user_data should not be passed without a callback to clean it up.
+ llassert(callback != NULL)
+ }
+
if (mShutDown)
{
llinfos << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl;
- return; // don't get the asset or do any callbacks, we are shutting down
+
+ if (callback)
+ {
+ callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE);
+ }
+ return;
}
-
+
if (uuid.isNull())
{
- // Special case early out for NULL uuid
+ // Special case early out for NULL uuid and for shutting down
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 767001b633..97f2792686 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -553,12 +553,10 @@ void LLAvatarNameCache::eraseUnrefreshed()
if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed)
{
sLastExpireCheck = now;
- cache_t::iterator it = sCache.begin();
- while (it != sCache.end())
+
+ for (cache_t::iterator it = sCache.begin(); it != sCache.end();)
{
- cache_t::iterator cur = it;
- ++it;
- const LLAvatarName& av_name = cur->second;
+ const LLAvatarName& av_name = it->second;
if (av_name.mExpires < max_unrefreshed)
{
const LLUUID& agent_id = it->first;
@@ -566,8 +564,12 @@ void LLAvatarNameCache::eraseUnrefreshed()
<< " user '" << av_name.mUsername << "' "
<< "expired " << now - av_name.mExpires << " secs ago"
<< LL_ENDL;
- sCache.erase(cur);
+ sCache.erase(it++);
}
+ else
+ {
+ ++it;
+ }
}
LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL;
}
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index a485fa0160..9b3b24c312 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -674,15 +674,7 @@ void LLCurl::Multi::removeEasy(Easy* easy)
//static
std::string LLCurl::strerror(CURLcode errorcode)
{
-#if LL_DARWIN
- // curl_easy_strerror was added in libcurl 7.12.0. Unfortunately, the version in the Mac OS X 10.3.9 SDK is 7.10.2...
- // There's a problem with the custom curl headers in our build that keeps me from #ifdefing this on the libcurl version number
- // (the correct check would be #if LIBCURL_VERSION_NUM >= 0x070c00). We'll fix the header problem soon, but for now
- // just punt and print the numeric error code on the Mac.
- return llformat("%d", errorcode);
-#else // LL_DARWIN
return std::string(curl_easy_strerror(errorcode));
-#endif // LL_DARWIN
}
////////////////////////////////////////////////////////////////////////////