summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorandreykproductengine <none@none>2016-12-01 13:58:24 +0200
committerandreykproductengine <none@none>2016-12-01 13:58:24 +0200
commitbd411d4503b66f0bd6df27b97d9e4bc56bf50e53 (patch)
tree0551dc98815387d83090161681ea7e60a92f6e2d /indra/newview/llappearancemgr.cpp
parent95826232bc7c8c695021a21eb79087e573635f24 (diff)
MAINT-6562 Avatar COF was occasionally failing to update because Not Found
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 2d84251da0..27d15b1bab 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3410,9 +3410,21 @@ LLSD LLAppearanceMgr::dumpCOF() const
return result;
}
+// static
+void LLAppearanceMgr::onIdle(void *)
+{
+ LLAppearanceMgr* mgr = LLAppearanceMgr::getInstance();
+ if (mgr->mRerequestAppearanceBake)
+ {
+ mgr->requestServerAppearanceUpdate();
+ }
+}
+
void LLAppearanceMgr::requestServerAppearanceUpdate()
{
- if (!mOutstandingAppearanceBakeRequest)
+ // Workaround: we shouldn't request update from server prior to uploading all attachments, but it is
+ // complicated to check for pending attachment uploads, so we are just waiting for uploads to complete
+ if (!mOutstandingAppearanceBakeRequest && gAssetStorage->getNumPendingUploads() == 0)
{
mRerequestAppearanceBake = false;
LLCoprocedureManager::CoProcedure_t proc = boost::bind(&LLAppearanceMgr::serverAppearanceUpdateCoro, this, _1);
@@ -3420,13 +3432,14 @@ void LLAppearanceMgr::requestServerAppearanceUpdate()
}
else
{
+ // Shedule update
mRerequestAppearanceBake = true;
}
}
void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter)
{
- mRerequestAppearanceBake = false;
+ BoolSetter outstanding(mOutstandingAppearanceBakeRequest);
if (!gAgent.getRegion())
{
LL_WARNS("Avatar") << "Region not set, cannot request server appearance update" << LL_ENDL;
@@ -3458,8 +3471,6 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd
bool bRetry;
do
{
- BoolSetter outstanding(mOutstandingAppearanceBakeRequest);
-
// If we have already received an update for this or higher cof version,
// put a warning in the log and cancel the request.
S32 cofVersion = getCOFVersion();
@@ -3571,12 +3582,6 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd
}
} while (bRetry);
-
- if (mRerequestAppearanceBake)
- { // A bake request came in while this one was still outstanding.
- // Requeue ourself for a later request.
- requestServerAppearanceUpdate();
- }
}
/*static*/
@@ -3956,6 +3961,7 @@ LLAppearanceMgr::LLAppearanceMgr():
"OutfitOperationsTimeout")));
gIdleCallbacks.addFunction(&LLAttachmentsMgr::onIdle, NULL);
+ gIdleCallbacks.addFunction(&LLAppearanceMgr::onIdle, NULL); //sheduling appearance update requests
}
LLAppearanceMgr::~LLAppearanceMgr()