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:
@@ -413,11 +413,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ bool followRedir() const
|
||||
{
|
||||
return mFollowRedir;
|
||||
}
|
||||
|
||||
/*virtual*/ bool followRedir() const { return mFollowRedir; }
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_texture; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return HTTPGetResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "HTTPGetResponder"; }
|
||||
|
||||
@@ -1275,7 +1272,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
|
||||
// AIPerService::approveHTTPRequestFor returns approvement for ONE request.
|
||||
// This object keeps track of whether or not that is honored.
|
||||
LLPointer<AIPerService::Approvement> approved = AIPerService::approveHTTPRequestFor(mPerServicePtr);
|
||||
LLPointer<AIPerService::Approvement> approved = AIPerService::approveHTTPRequestFor(mPerServicePtr, cap_texture);
|
||||
if (!approved)
|
||||
{
|
||||
return false ; //wait.
|
||||
|
||||
Reference in New Issue
Block a user