From 9a8a28ee1a87d504fe6e66043ebf3cf35b088643 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Thu, 28 Apr 2011 01:50:51 +0200 Subject: [PATCH] HTTP fetch bandwidth limited again --- indra/newview/lltexturefetch.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index aa3835c4c..0655b509e 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1251,8 +1251,11 @@ bool LLTextureFetchWorker::doWork(S32 param) //1, not openning too many file descriptors at the same time; //2, control the traffic of http so udp gets bandwidth. // - static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 8 ; - if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) + static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 32; + 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. }