HTTP fetch bandwidth limited again

This commit is contained in:
Siana Gearz
2011-04-28 01:50:51 +02:00
parent 51133c3894
commit 9a8a28ee1a

View File

@@ -1251,8 +1251,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
//1, not openning too many file descriptors at the same time; //1, not openning too many file descriptors at the same time;
//2, control the traffic of http so udp gets bandwidth. //2, control the traffic of http so udp gets bandwidth.
// //
static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 8 ; static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 32;
if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) static const S32 NUM_REQUESTS_TILL_THRESHOLDING = 2;
if((mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) ||
((mFetcher->getTextureBandwidth() > mFetcher->mMaxBandwidth) &&
mFetcher->getNumHTTPRequests() > NUM_REQUESTS_TILL_THRESHOLDING))
{ {
return false ; //wait. return false ; //wait.
} }