Read MeshMaxConcurrentRequests and Mesh2MaxConcurrentRequests default setting from settings.xml if we reset it due to exceeding the limits

Tue, 25 Feb 2014 19:25:42 +0100

author
Ansariel
date
Tue, 25 Feb 2014 19:25:42 +0100
changeset 40768
19a2aa26190d
parent 40767
1afc8f41308e
child 40769
92ad398246a2

Read MeshMaxConcurrentRequests and Mesh2MaxConcurrentRequests default setting from settings.xml if we reset it due to exceeding the limits

indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llmeshrepository.cpp	Tue Feb 25 19:00:56 2014 +0100
     1.2 +++ b/indra/newview/llmeshrepository.cpp	Tue Feb 25 19:25:42 2014 +0100
     1.3 @@ -379,9 +379,7 @@
     1.4  
     1.5  //<FS:TS> FIRE-11451: Cap concurrent mesh requests at a sane value 
     1.6  const U32 MESH_CONCURRENT_REQUEST_LIMIT = 64;  // upper limit 
     1.7 -const U32 MESH_CONCURRENT_REQUEST_RESET = 16;  // reset to this if too high 
     1.8  const U32 MESH2_CONCURRENT_REQUEST_LIMIT = 32;  // upper limit 
     1.9 -const U32 MESH2_CONCURRENT_REQUEST_RESET = 8;  // reset to this if too high 
    1.10  //</FS:TS> FIRE-11451 
    1.11  
    1.12  U32 LLMeshRepository::sBytesReceived = 0;
    1.13 @@ -3202,19 +3200,20 @@
    1.14  		// <FS:Ansariel> Use faster LLCachedControls for frequently visited locations
    1.15  		//LLMeshRepoThread::sMaxConcurrentRequests = gSavedSettings.getU32("MeshMaxConcurrentRequests");
    1.16  		static LLCachedControl<U32> meshMaxConcurrentRequests(gSavedSettings, "MeshMaxConcurrentRequests");
    1.17 -		//<FS:TS> FIRE-11451: Cap concurrent requests at a sane value 
    1.18 -		if ((U32)meshMaxConcurrentRequests > MESH_CONCURRENT_REQUEST_LIMIT) 
    1.19 -		{ 
    1.20 +		//<FS:TS> FIRE-11451: Cap concurrent requests at a sane value
    1.21 +		if (meshMaxConcurrentRequests() > MESH_CONCURRENT_REQUEST_LIMIT) 
    1.22 +		{
    1.23 +			U32 mesh_max_concurrent_requests_default = gSavedSettings.getControl("MeshMaxConcurrentRequests")->getDefault().asInteger();
    1.24  			LLSD args; 
    1.25 -			args["VALUE"] = llformat("%d", (U32)meshMaxConcurrentRequests); 
    1.26 +			args["VALUE"] = llformat("%d", meshMaxConcurrentRequests()); 
    1.27  			args["MAX"] = llformat("%d", MESH_CONCURRENT_REQUEST_LIMIT); 
    1.28 -			args["DEFAULT"] = llformat("%d", MESH_CONCURRENT_REQUEST_RESET);
    1.29 +			args["DEFAULT"] = llformat("%d", mesh_max_concurrent_requests_default);
    1.30  			args["DEBUGNAME"] = "MeshMaxConccurrentRequests";
    1.31  			LLNotificationsUtil::add("MeshMaxConcurrentReqTooHigh", args); 
    1.32 -			gSavedSettings.setU32("MeshMaxConcurrentRequests",MESH_CONCURRENT_REQUEST_RESET);
    1.33 +			gSavedSettings.setU32("MeshMaxConcurrentRequests", mesh_max_concurrent_requests_default);
    1.34  		}
    1.35  		//</FS:TS> FIRE-11451 
    1.36 -		LLMeshRepoThread::sMaxConcurrentRequests = (U32)meshMaxConcurrentRequests;
    1.37 +		LLMeshRepoThread::sMaxConcurrentRequests = meshMaxConcurrentRequests();
    1.38  		// </FS:Ansariel>
    1.39  		LLMeshRepoThread::sRequestHighWater = llclamp(2 * S32(LLMeshRepoThread::sMaxConcurrentRequests),
    1.40  													  REQUEST_HIGH_WATER_MIN,
    1.41 @@ -3230,19 +3229,20 @@
    1.42  		// <FS:TM> Use faster LLCachedControls for frequently visited locations
    1.43  		//LLMeshRepoThread::sMaxConcurrentRequests = gSavedSettings.getU32("Mesh2MaxConcurrentRequests");
    1.44  		static LLCachedControl<U32> mesh2MaxConcurrentRequests(gSavedSettings, "Mesh2MaxConcurrentRequests");
    1.45 -		//<FS:TS> FIRE-11451: Cap concurrent requests at a sane value 
    1.46 -		if ((U32)mesh2MaxConcurrentRequests > MESH2_CONCURRENT_REQUEST_LIMIT) 
    1.47 +		//<FS:TS> FIRE-11451: Cap concurrent requests at a sane value
    1.48 +		if (mesh2MaxConcurrentRequests() > MESH2_CONCURRENT_REQUEST_LIMIT) 
    1.49  		{ 
    1.50 +			U32 mesh2_max_concurrent_requests_default = gSavedSettings.getControl("Mesh2MaxConcurrentRequests")->getDefault().asInteger();
    1.51  			LLSD args; 
    1.52 -			args["VALUE"] = llformat("%d", (U32)mesh2MaxConcurrentRequests); 
    1.53 +			args["VALUE"] = llformat("%d", mesh2MaxConcurrentRequests()); 
    1.54  			args["MAX"] = llformat("%d", MESH2_CONCURRENT_REQUEST_LIMIT); 
    1.55 -			args["DEFAULT"] = llformat("%d", MESH2_CONCURRENT_REQUEST_RESET);
    1.56 +			args["DEFAULT"] = llformat("%d", mesh2_max_concurrent_requests_default);
    1.57  			args["DEBUGNAME"] = "Mesh2MaxConccurrentRequests";
    1.58  			LLNotificationsUtil::add("MeshMaxConcurrentReqTooHigh", args); 
    1.59 -			gSavedSettings.setU32("Mesh2MaxConcurrentRequests",MESH2_CONCURRENT_REQUEST_RESET);
    1.60 +			gSavedSettings.setU32("Mesh2MaxConcurrentRequests", mesh2_max_concurrent_requests_default);
    1.61  		}
    1.62  		//</FS:TS> FIRE-11451 
    1.63 -		LLMeshRepoThread::sMaxConcurrentRequests = (U32)mesh2MaxConcurrentRequests;
    1.64 +		LLMeshRepoThread::sMaxConcurrentRequests = mesh2MaxConcurrentRequests();
    1.65  		// </FS:TM>
    1.66  		LLMeshRepoThread::sRequestHighWater = llclamp(5 * S32(LLMeshRepoThread::sMaxConcurrentRequests),
    1.67  													  REQUEST2_HIGH_WATER_MIN,

mercurial