summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-17 03:23:15 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-17 03:48:45 +0200
commit3a5c41a20e6044c8cfa71dfd1583fea0809d6a68 (patch)
tree1d74892c5b85f37661afaf37c94194bed095bf44 /indra/newview
parent86c46a12296a8f00dd6db33a69fffe55e6520326 (diff)
SL-18629 Fetch Inventory using AIS caps #4
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.cpp28
-rw-r--r--indra/newview/llstartup.cpp5
2 files changed, 21 insertions, 12 deletions
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index 098ced4ec9..282d234cf3 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -293,23 +293,20 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive)
}
else
{
- if (AISAPI::isAvailable() && !recursive)
+ if (mFetchQueue.empty() || mFetchQueue.front().mUUID != id)
{
- // Specific folder requests go to front of queue.
- if (mFetchQueue.empty() || mFetchQueue.back().mUUID != id)
+ if (AISAPI::isAvailable())
{
+ // On AIS make sure root goes to the top and follow up recursive
+ // fetches, not individual requests
mFetchQueue.push_back(FetchQueueInfo(id, recursion_type));
- gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
}
- }
- else
- {
- // Specific folder requests go to front of queue.
- if (mFetchQueue.empty() || mFetchQueue.front().mUUID != id)
+ else
{
+ // Specific folder requests go to front of queue.
mFetchQueue.push_front(FetchQueueInfo(id, recursion_type));
- gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
}
+ gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
}
if (id == gInventory.getLibraryRootFolderID())
@@ -419,7 +416,7 @@ void LLInventoryModelBackgroundFetch::onAISCalback(const LLUUID &request_id, con
it != categories->end();
++it)
{
- mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), RT_RECURSIVE));
+ mFetchQueue.push_front(FetchQueueInfo((*it)->getUUID(), RT_RECURSIVE));
}
if (!mFetchQueue.empty())
{
@@ -449,11 +446,17 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
return;
}
- while (!mFetchQueue.empty() && mFetchCount < max_concurrent_fetches)
+ // Don't loop for too long (in case of large, fully loaded inventory)
+ F64 curent_time = LLTimer::getTotalSeconds();
+ const F64 max_time = 0.006f; // 6 ms
+ const F64 end_time = curent_time + max_time;
+
+ while (!mFetchQueue.empty() && mFetchCount < max_concurrent_fetches && curent_time < end_time)
{
const FetchQueueInfo & fetch_info(mFetchQueue.front());
bulkFetchViaAis(fetch_info);
mFetchQueue.pop_front();
+ curent_time = LLTimer::getTotalSeconds();
}
if (isBulkFetchProcessingComplete())
@@ -513,6 +516,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
it != categories->end();
++it)
{
+ // not push_front to not cause an infinite loop
mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive));
}
}
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 842192a62b..a1f2753ada 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2930,6 +2930,11 @@ void reset_login()
LLFloaterReg::hideVisibleInstances();
LLStartUp::setStartupState( STATE_BROWSER_INIT );
+ if (LLVoiceClient::instanceExists())
+ {
+ LLVoiceClient::getInstance()->terminate();
+ }
+
// Clear any verified certs and verify them again on next login
// to ensure cert matches server instead of just getting reused
LLPointer<LLCertificateStore> store = gSecAPIHandler->getCertificateStore("");