summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2016-12-02 12:43:26 +0000
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2016-12-02 12:43:26 +0000
commit0eeb9c87e8aa1c682c1acb996fe3f2ca5b24eda4 (patch)
treeb109c1df51d2d2528f461b8de6040c39fee2fe94 /indra/newview
parent4daba484b02479a7d7ef503832ad2fa6869d2fdb (diff)
parentbd411d4503b66f0bd6df27b97d9e4bc56bf50e53 (diff)
Merged in MAINT-6562
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappearancemgr.cpp26
-rw-r--r--indra/newview/llappearancemgr.h2
2 files changed, 17 insertions, 11 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()
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 5948dd870c..166c663feb 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -225,6 +225,7 @@ public:
bool isInUpdateAppearanceFromCOF() { return mIsInUpdateAppearanceFromCOF; }
+ static void onIdle(void *);
void requestServerAppearanceUpdate();
void setAppearanceServiceURL(const std::string& url) { mAppearanceServiceURL = url; }
@@ -235,7 +236,6 @@ public:
boost::signals2::connection setAttachmentsChangedCallback(attachments_changed_callback_t cb);
-
private:
void serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter);