Temporarily add old bandwidth throttle method back.

This commit is contained in:
Aleric Inglewood
2013-04-08 22:56:57 +02:00
parent 748d339ee6
commit 3af89dd685
3 changed files with 6 additions and 8 deletions

View File

@@ -140,7 +140,7 @@ class AIPerHostRequestQueue {
// Returns true if curl can handle another request for this host. // Returns true if curl can handle another request for this host.
// Should return false if the maximum allowed HTTP bandwidth is reached, or when // Should return false if the maximum allowed HTTP bandwidth is reached, or when
// the latency between request and actual delivery becomes too large. // the latency between request and actual delivery becomes too large.
static bool wantsMoreHTTPRequestsFor(AIPerHostRequestQueuePtr const& per_host); static bool wantsMoreHTTPRequestsFor(AIPerHostRequestQueuePtr const& per_host, bool too_much_bandwidth);
private: private:
// Disallow copying. // Disallow copying.

View File

@@ -2560,7 +2560,7 @@ U32 getNumHTTPAdded(void)
// running requests (in MultiHandle::mAddedEasyRequests)). // running requests (in MultiHandle::mAddedEasyRequests)).
// //
//static //static
bool AIPerHostRequestQueue::wantsMoreHTTPRequestsFor(AIPerHostRequestQueuePtr const& per_host) bool AIPerHostRequestQueue::wantsMoreHTTPRequestsFor(AIPerHostRequestQueuePtr const& per_host, bool too_much_bandwidth)
{ {
using namespace AICurlPrivate; using namespace AICurlPrivate;
using namespace AICurlPrivate::curlthread; using namespace AICurlPrivate::curlthread;
@@ -2621,14 +2621,11 @@ bool AIPerHostRequestQueue::wantsMoreHTTPRequestsFor(AIPerHostRequestQueuePtr co
return false; return false;
} }
#if 0 //AIFIXME: better bandwidth check here.
//AITODO: better bandwidth check here. if (too_much_bandwidth)
static const LLCachedControl<F32> throttle_bandwidth("HTTPThrottleBandwidth", 2000);
if (mFetcher->getTextureBandwidth() > throttle_bandwidth)
{ {
return false; // wait return false; // wait
} }
#endif
// Check if it's ok to get a new request based on the total number of requests and increment the threshold if appropriate. // Check if it's ok to get a new request based on the total number of requests and increment the threshold if appropriate.

View File

@@ -1271,7 +1271,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
} }
// Let AICurl decide if we can process more HTTP requests at the moment or not. // Let AICurl decide if we can process more HTTP requests at the moment or not.
if (!AIPerHostRequestQueue::wantsMoreHTTPRequestsFor(mPerHostPtr)) static const LLCachedControl<F32> throttle_bandwidth("HTTPThrottleBandwidth", 2000);
if (!AIPerHostRequestQueue::wantsMoreHTTPRequestsFor(mPerHostPtr, mFetcher->getTextureBandwidth() > throttle_bandwidth))
{ {
return false ; //wait. return false ; //wait.
} }