diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-04-19 00:20:09 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-04-19 00:20:27 +0300 |
commit | 97b0f637dfbd4ab2b3fe79442e9f847cf7a6efca (patch) | |
tree | e816e1d246b089ca65473062a67e4a3783244afc /indra/newview/llinventorymodelbackgroundfetch.cpp | |
parent | ce2aaab15912693d51383274dc1dfebb20c0b6a2 (diff) |
SL-19533 Check descendants even for a recursive fetch
Diffstat (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp')
-rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 56646830a2..bfb5ad9d12 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -486,6 +486,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i return; } + bool request_descendants = false; if (response_id.isNull()) // Failure { LL_DEBUGS(LOG_INV , "AIS3") << "Failure response for folder " << request_id << LL_ENDL; @@ -501,36 +502,37 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i else if (recursion == FT_CONTENT_RECURSIVE) { LL_WARNS() << "Failed to download folder: " << request_id << " Requesting known content separately" << LL_ENDL; - LLInventoryModel::cat_array_t *categories(NULL); - LLInventoryModel::item_array_t *items(NULL); - gInventory.getDirectDescendentsOf(request_id, categories, items); - if (categories) - { - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it) - { - mFetchFolderQueue.push_front(FetchQueueInfo((*it)->getUUID(), FT_RECURSIVE)); - } - if (!mFetchFolderQueue.empty()) - { - mBackgroundFetchActive = true; - mFolderFetchActive = true; - gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); - } - } + request_descendants = true; } } else { - LL_DEBUGS(LOG_INV , "AIS3") << "Got folder " << request_id << LL_ENDL; - if (recursion == FT_CONTENT_RECURSIVE) + if (recursion == FT_CONTENT_RECURSIVE || recursion == FT_RECURSIVE) { // Got the folder, now recursively request content - LLInventoryModel::cat_array_t * categories(NULL); - LLInventoryModel::item_array_t * items(NULL); - gInventory.getDirectDescendentsOf(request_id, categories, items); + // Request content even for FT_RECURSIVE in case of changes, failures + // or if depth limit gets imlemented. + // This shouldn't redownload folders if they already have version + request_descendants = true; + LL_DEBUGS(LOG_INV, "AIS3") << "Got folder " << request_id << ". Requesting content" << LL_ENDL; + } + else + { + LL_DEBUGS(LOG_INV, "AIS3") << "Got folder " << request_id << "." << LL_ENDL; + } + + } + + if (request_descendants) + { + LLInventoryModel::cat_array_t* categories(NULL); + LLInventoryModel::item_array_t* items(NULL); + gInventory.getDirectDescendentsOf(request_id, categories, items); + if (categories) + { for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); - it != categories->end(); - ++it) + it != categories->end(); + ++it) { mFetchFolderQueue.push_front(FetchQueueInfo((*it)->getUUID(), FT_RECURSIVE)); } |