diff options
Diffstat (limited to 'indra/newview/llattachmentsmgr.cpp')
-rwxr-xr-x | indra/newview/llattachmentsmgr.cpp | 24 |
1 files changed, 22 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) |