Commits

BaoLinden committed 8a536e2

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)

Comments (0)

Files changed (1)

indra/newview/lltexturefetch.cpp

 		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;