Added AICapabilityType and related.
This splits the AIPerService queue up into four queues: one for each "capability type". On Second Life that doesn't make a difference in itself for textures because the texture service only serves one capability type: textures. Other services however can serve two types, while on Avination - that currently only has one services for everything - this really makes a difference because that single service now has four queues. More importantly however is that the administration of how many requests are in the "pipeline" (from approving that a new HTTP request may be added for given service, till curl finished it) is now per capability type (or service/capabitity type pair actually). This means downloads of a certain capability type (textures, inventory, mesh, other) will no longer stall because unapproved requests cluttered the queue for a given service. Moreover, before when a request did finished, it would only look for a new request in the queue of the service that just finished. This simple algorithm worked when there were no 'PerSerice' objects, and only one 'Curl' queue: because if anything was queued that that was because there were running requests, and when one of those running requests finished it made sense to see if one of those queued requests could be added now. However, after adding multiple queues, one for each service, it could happen that service A had queued requests while only requests from service B were actually running: only requests of B would ever finish and the requests of A would be queued forever. With this patch the algorithm is to look alternating first in the texture request queue and then in the inventory request queue - or vice versa, and if there are none of those, look for a request of a different type. If also that cannot be found, look for a request in another service. This is still not optimal and subject to change.
This commit is contained in:
@@ -420,6 +420,7 @@ class LLInventoryModelFetchDescendentsResponder : public LLHTTPClient::Responder
|
||||
{};
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_inventory; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return inventoryModelFetchDescendentsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLInventoryModelFetchDescendentsResponder"; }
|
||||
|
||||
@@ -652,7 +653,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
|
||||
{
|
||||
if (folder_lib_count == max_batch_size ||
|
||||
(folder_lib_count == 0 &&
|
||||
!(approved_folder_lib = AIPerService::approveHTTPRequestFor(mPerServicePtr))))
|
||||
!(approved_folder_lib = AIPerService::approveHTTPRequestFor(mPerServicePtr, cap_inventory))))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -663,7 +664,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
|
||||
{
|
||||
if (folder_count == max_batch_size ||
|
||||
(folder_count == 0 &&
|
||||
!(approved_folder = AIPerService::approveHTTPRequestFor(mPerServicePtr))))
|
||||
!(approved_folder = AIPerService::approveHTTPRequestFor(mPerServicePtr, cap_inventory))))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -701,7 +702,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
|
||||
{
|
||||
if (item_count == max_batch_size ||
|
||||
(item_count == 0 &&
|
||||
!(approved_item = AIPerService::approveHTTPRequestFor(mPerServicePtr))))
|
||||
!(approved_item = AIPerService::approveHTTPRequestFor(mPerServicePtr, cap_inventory))))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -712,7 +713,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
|
||||
{
|
||||
if (item_lib_count == max_batch_size ||
|
||||
(item_lib_count == 0 &&
|
||||
!(approved_item_lib = AIPerService::approveHTTPRequestFor(mPerServicePtr))))
|
||||
!(approved_item_lib = AIPerService::approveHTTPRequestFor(mPerServicePtr, cap_inventory))))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user