summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2011-08-22 23:41:54 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2011-08-22 23:41:54 +0300
commit056015963290e47e03972e17ce6d603f8f940fe3 (patch)
tree7a8329b2cb6525d809f7fe8ce921b7aeb99f16f8 /indra
parentca8a484f0ee4bcb9b68268f871082d4200062f0e (diff)
SH-2171 ADDITIONAL FIX Added transaction ID to object weights requests to avoid updating the floater upon outdated or mixed up replies arrival.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llaccountingcostmanager.cpp14
-rw-r--r--indra/newview/llaccountingcostmanager.h4
-rw-r--r--indra/newview/llfloaterobjectweights.cpp9
-rw-r--r--indra/newview/llfloaterobjectweights.h2
4 files changed, 26 insertions, 3 deletions
diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index 0669bdfffa..3717344aef 100644
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -41,8 +41,13 @@ public:
: mObjectIDs( objectIDs ),
mObserverHandle( observer_handle )
{
+ LLAccountingCostObserver* observer = mObserverHandle.get();
+ if (observer)
+ {
+ mTransactionID = observer->getTransactionID();
+ }
}
-
+
void clearPendingRequests ( void )
{
for ( LLSD::array_iterator iter = mObjectIDs.beginArray(); iter != mObjectIDs.endArray(); ++iter )
@@ -57,7 +62,7 @@ public:
clearPendingRequests();
LLAccountingCostObserver* observer = mObserverHandle.get();
- if (observer)
+ if (observer && observer->getTransactionID() == mTransactionID)
{
observer->setErrorStatus(statusNum, reason);
}
@@ -86,7 +91,7 @@ public:
SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
LLAccountingCostObserver* observer = mObserverHandle.get();
- if (observer)
+ if (observer && observer->getTransactionID() == mTransactionID)
{
observer->onWeightsUpdate(selectionCost);
}
@@ -99,6 +104,9 @@ private:
//List of posted objects
LLSD mObjectIDs;
+ // Current request ID
+ LLUUID mTransactionID;
+
// Cost update observer handle
LLHandle<LLAccountingCostObserver> mObserverHandle;
};
diff --git a/indra/newview/llaccountingcostmanager.h b/indra/newview/llaccountingcostmanager.h
index cccdc2e2d9..0bca1f54ef 100644
--- a/indra/newview/llaccountingcostmanager.h
+++ b/indra/newview/llaccountingcostmanager.h
@@ -40,9 +40,13 @@ public:
virtual void onWeightsUpdate(const SelectionCost& selection_cost) = 0;
virtual void setErrorStatus(U32 status, const std::string& reason) = 0;
const LLHandle<LLAccountingCostObserver>& getObserverHandle() const { return mObserverHandle; }
+ const LLUUID& getTransactionID() { return mTransactionID; }
protected:
+ virtual void generateTransactionID() = 0;
+
LLRootHandle<LLAccountingCostObserver> mObserverHandle;
+ LLUUID mTransactionID;
};
//===============================================================================
class LLAccountingCostManager : public LLSingleton<LLAccountingCostManager>
diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 7bfa8454b6..0862cd2897 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -198,6 +198,9 @@ void LLFloaterObjectWeights::refresh()
std::string url = region->getCapability("ResourceCostSelected");
if (!url.empty())
{
+ // Update the transaction id before the new fetch request
+ generateTransactionID();
+
LLAccountingCostManager::getInstance()->fetchCosts(Roots, url, getObserverHandle());
toggleWeightsLoadingIndicators(true);
}
@@ -209,6 +212,12 @@ void LLFloaterObjectWeights::refresh()
}
}
+// virtual
+void LLFloaterObjectWeights::generateTransactionID()
+{
+ mTransactionID.generate();
+}
+
void LLFloaterObjectWeights::toggleWeightsLoadingIndicators(bool visible)
{
childSetVisible("download_loading_indicator", visible);
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
index 64aa2f2bbe..9a244573be 100644
--- a/indra/newview/llfloaterobjectweights.h
+++ b/indra/newview/llfloaterobjectweights.h
@@ -69,6 +69,8 @@ public:
void refresh();
private:
+ /*virtual*/ void generateTransactionID();
+
void toggleWeightsLoadingIndicators(bool visible);
void toggleLandImpactsLoadingIndicators(bool visible);