summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llattachmentsmgr.cpp24
-rwxr-xr-xindra/newview/llattachmentsmgr.h1
2 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index fa2d95a1e6..ae9560211f 100755
--- a/indra/newview/llattachmentsmgr.cpp
+++ b/indra/newview/llattachmentsmgr.cpp
@@ -94,6 +94,8 @@ void LLAttachmentsMgr::onIdle()
linkRecentlyArrivedAttachments();
expireOldAttachmentRequests();
+
+ expireOldDetachRequests();
}
void LLAttachmentsMgr::requestPendingAttachments()
@@ -308,17 +310,35 @@ void LLAttachmentsMgr::expireOldAttachmentRequests()
{
std::map<LLUUID,LLTimer>::iterator curr_it = it;
++it;
- if (it->second.getElapsedTimeF32() > MAX_ATTACHMENT_REQUEST_LIFETIME)
+ if (curr_it->second.getElapsedTimeF32() > MAX_ATTACHMENT_REQUEST_LIFETIME)
{
LLInventoryItem *item = gInventory.getItem(curr_it->first);
LL_DEBUGS("Avatar") << "ATT expiring request for attachment "
- << (item ? item->getName() : "UNKNOWN") << "item_id " << curr_it->first
+ << (item ? item->getName() : "UNKNOWN") << " item_id " << curr_it->first
<< " after " << MAX_ATTACHMENT_REQUEST_LIFETIME << " seconds" << LL_ENDL;
mAttachmentRequests.erase(curr_it);
}
}
}
+void LLAttachmentsMgr::expireOldDetachRequests()
+{
+ for (std::map<LLUUID,LLTimer>::iterator it = mDetachRequests.begin();
+ it != mDetachRequests.end(); )
+ {
+ std::map<LLUUID,LLTimer>::iterator curr_it = it;
+ ++it;
+ if (curr_it->second.getElapsedTimeF32() > MAX_ATTACHMENT_REQUEST_LIFETIME)
+ {
+ LLInventoryItem *item = gInventory.getItem(curr_it->first);
+ LL_DEBUGS("Avatar") << "ATT expiring request for detach "
+ << (item ? item->getName() : "UNKNOWN") << " item_id " << curr_it->first
+ << " after " << MAX_ATTACHMENT_REQUEST_LIFETIME << " seconds" << LL_ENDL;
+ mDetachRequests.erase(curr_it);
+ }
+ }
+}
+
// When an attachment arrives, we want to stop waiting for it, and add
// it to the set of recently arrived items.
void LLAttachmentsMgr::onAttachmentArrived(const LLUUID& inv_item_id)
diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h
index 2834c10a2f..ae678b4007 100755
--- a/indra/newview/llattachmentsmgr.h
+++ b/indra/newview/llattachmentsmgr.h
@@ -107,6 +107,7 @@ private:
void requestPendingAttachments();
void linkRecentlyArrivedAttachments();
void expireOldAttachmentRequests();
+ void expireOldDetachRequests();
// Attachments that we are planning to rez but haven't requested from the server yet.
attachments_vec_t mPendingAttachments;