From 38a0dbf04f24fc22f504485cdcd1efb274fc9a46 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 15 Apr 2011 18:50:03 +0300 Subject: STORM-1039 FIXED Bad iterator access in llavatarnamecache.cpp:564 - Replaced 'while' loop by 'for' - Deleted unnecessary 'cur' iterator --- indra/llmessage/llavatarnamecache.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 767001b633..33e6709983 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(); ++it) { - 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,7 +564,7 @@ void LLAvatarNameCache::eraseUnrefreshed() << " user '" << av_name.mUsername << "' " << "expired " << now - av_name.mExpires << " secs ago" << LL_ENDL; - sCache.erase(cur); + sCache.erase(it); } } LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; -- cgit v1.2.3 From e26bfe00ef467a65eb126a75fa2aba6ccd5cd07a Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 22 Apr 2011 01:07:52 +0300 Subject: STORM-380 FIXED Added syncing animations and sounds before the gesture starts playing. The actual playing of animations and sounds of a gesture starts only when all needed animations and sound files are loaded into viewer cache. This reduces the delay between animations and sounds meant to be played simultaneously but may increase the delay between the moment a gesture is triggered and the moment it starts playing. Fixed calling assets callback to clean up the void pointer in getAssetData() and avoid potential memory leaks. --- indra/llmessage/llassetstorage.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'indra/llmessage') 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); -- cgit v1.2.3 From 6e5794376d5b64dffd965265d484e67346e02f31 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Apr 2011 19:04:08 -0700 Subject: STORM-1039 FIXED Bad iterator access in llavatarnamecache.cpp:564 fixed crash on startup --- indra/llmessage/llavatarnamecache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 33e6709983..e0b77e3105 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -554,7 +554,7 @@ void LLAvatarNameCache::eraseUnrefreshed() { sLastExpireCheck = now; - for (cache_t::iterator it = sCache.begin(); it != sCache.end(); ++it) + for (cache_t::iterator it = sCache.begin(); it != sCache.end();) { const LLAvatarName& av_name = it->second; if (av_name.mExpires < max_unrefreshed) @@ -564,7 +564,7 @@ void LLAvatarNameCache::eraseUnrefreshed() << " user '" << av_name.mUsername << "' " << "expired " << now - av_name.mExpires << " secs ago" << LL_ENDL; - sCache.erase(it); + sCache.erase(it++); } } LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; -- cgit v1.2.3 From 72c43237fc184d07936edbc4f1dbd18d394c4ce9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Apr 2011 19:33:20 -0700 Subject: STORM-1039 FIXED Bad iterator access in llavatarnamecache.cpp:564 missed else case --- indra/llmessage/llavatarnamecache.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index e0b77e3105..97f2792686 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -566,6 +566,10 @@ void LLAvatarNameCache::eraseUnrefreshed() << LL_ENDL; sCache.erase(it++); } + else + { + ++it; + } } LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; } -- cgit v1.2.3 From 3063c1be4105feab28e6d6abf745b5ab6043ba25 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 4 May 2011 16:27:59 -0700 Subject: EXP-772 -- Log in failure, keeps saying DNS cannot resolve hostname. No real progress on this Jira yet but Mac build was not properly reporting the CURL error string. This check-in fixes that. So far, I have backed out URL related changes between 2.6.2 and 2.6.3 without any change in behavior. Unsure how to proceed next although comparing libcares and libcurl builds between 2.6.2 and 2.6.3 seems like it could be the next logical step. Users experiencing the problem can go back to vewere 2.6.2 or adjust DNS settings to use the google free DNS servers 8.8.8.8 and 8.8.4.4 which should allow them to work around the problem. Reviewed by Richard. --- indra/llmessage/llcurl.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'indra/llmessage') 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 } //////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3