diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2010-09-22 14:44:40 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2010-09-22 14:44:40 -0600 |
commit | 3cd522c5a6dd71a61769a65a7e6fa39a55fcf73b (patch) | |
tree | 77a6ae10e1dc19630a002d9fdf6436498eeec1a3 /indra | |
parent | 1df1f822aa4f8633207023ef78f9aa4606649732 (diff) |
fix for SH-173/VWR-22868: Development Viewer freezes just after startup / greedy with file handles / 'WARNING: ll_apr_warn_status: APR: Too many open files'
(transplanted from a9aefa70c029eb9dddec3833d0ce22ef4b4421b5)
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 4e9ebce4d1..fafef84aa2 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -847,10 +847,16 @@ bool LLTextureFetchWorker::doWork(S32 param) if(mCanUseHTTP) { //NOTE: - //it seems ok to let sim control the UDP traffic - //so there is no throttle for http here. + //control the number of the http requests issued for: + //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 = 32 ; + if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) + { + return false ; //wait. + } + mFetcher->removeFromNetworkQueue(this, false); S32 cur_size = 0; |