SH-4371 Reduce 22mS inter-connection latency.

Tue, 30 Jul 2013 15:21:31 -0400

author
Monty Brandenberg <monty@lindenlab.com>
date
Tue, 30 Jul 2013 15:21:31 -0400
changeset 40701
708f569ab46b
parent 40700
3d802c6426bf
child 40702
8e25ca0fe818

SH-4371 Reduce 22mS inter-connection latency.
This really extended into the client-side request throttling.
Moved this from llmeshrepository (which doesn't really want
to do connection management) into llcorehttp. It's now a
class option with configurable rate. This still isn't the
right thing to do as it creates coupling between viewer
and services. When we get to pipelining, this notion becomes
invalid.

indra/llcorehttp/_httpinternal.h file | annotate | diff | revisions
indra/llcorehttp/_httppolicy.cpp file | annotate | diff | revisions
indra/llcorehttp/_httppolicyclass.cpp file | annotate | diff | revisions
indra/llcorehttp/_httppolicyclass.h file | annotate | diff | revisions
indra/llcorehttp/_httpservice.cpp file | annotate | diff | revisions
indra/llcorehttp/httprequest.h file | annotate | diff | revisions
indra/newview/llappcorehttp.cpp file | annotate | diff | revisions
indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
indra/newview/llmeshrepository.h file | annotate | diff | revisions
     1.1 --- a/indra/llcorehttp/_httpinternal.h	Mon Jul 29 16:26:02 2013 -0400
     1.2 +++ b/indra/llcorehttp/_httpinternal.h	Tue Jul 30 15:21:31 2013 -0400
     1.3 @@ -143,6 +143,7 @@
     1.4  // Miscellaneous defaults
     1.5  const long HTTP_PIPELINING_DEFAULT = 0L;
     1.6  const bool HTTP_USE_RETRY_AFTER_DEFAULT = true;
     1.7 +const long HTTP_THROTTLE_RATE_DEFAULT = 0L;
     1.8  
     1.9  // Tuning parameters
    1.10  
     2.1 --- a/indra/llcorehttp/_httppolicy.cpp	Mon Jul 29 16:26:02 2013 -0400
     2.2 +++ b/indra/llcorehttp/_httppolicy.cpp	Tue Jul 30 15:21:31 2013 -0400
     2.3 @@ -49,12 +49,18 @@
     2.4  {
     2.5  public:
     2.6  	ClassState()
     2.7 +		: mThrottleEnd(0),
     2.8 +		  mThrottleLeft(0L),
     2.9 +		  mRequestCount(0L)
    2.10  		{}
    2.11  	
    2.12  	HttpReadyQueue		mReadyQueue;
    2.13  	HttpRetryQueue		mRetryQueue;
    2.14  
    2.15  	HttpPolicyClass		mOptions;
    2.16 +	HttpTime			mThrottleEnd;
    2.17 +	long				mThrottleLeft;
    2.18 +	long				mRequestCount;
    2.19  };
    2.20  
    2.21  
    2.22 @@ -190,6 +196,13 @@
    2.23  // the worker thread may sleep hard otherwise will ask for
    2.24  // normal polling frequency.
    2.25  //
    2.26 +// Implements a client-side request rate throttle as well.
    2.27 +// This is intended to mimic and predict throttling behavior
    2.28 +// of grid services but that is difficult to do with different
    2.29 +// time bases.  This also represents a rigid coupling between
    2.30 +// viewer and server that makes it hard to change parameters
    2.31 +// and I hope we can make this go away with pipelining.
    2.32 +//
    2.33  HttpService::ELoopSpeed HttpPolicy::processReadyQueue()
    2.34  {
    2.35  	const HttpTime now(totalTime());
    2.36 @@ -199,12 +212,22 @@
    2.37  	for (int policy_class(0); policy_class < mClasses.size(); ++policy_class)
    2.38  	{
    2.39  		ClassState & state(*mClasses[policy_class]);
    2.40 +		const bool throttle_enabled(state.mOptions.mThrottleRate > 0L);
    2.41 +		const bool throttle_current(throttle_enabled && now < state.mThrottleEnd);
    2.42 +
    2.43 +		if (throttle_current && state.mThrottleLeft <= 0)
    2.44 +		{
    2.45 +			// Throttled condition, don't serve this class but don't sleep hard.
    2.46 +			result = HttpService::NORMAL;
    2.47 +			continue;
    2.48 +		}
    2.49 +
    2.50  		int active(transport.getActiveCountInClass(policy_class));
    2.51  		int needed(state.mOptions.mConnectionLimit - active);		// Expect negatives here
    2.52  
    2.53  		HttpRetryQueue & retryq(state.mRetryQueue);
    2.54  		HttpReadyQueue & readyq(state.mReadyQueue);
    2.55 -		
    2.56 +
    2.57  		if (needed > 0)
    2.58  		{
    2.59  			// First see if we have any retries...
    2.60 @@ -218,10 +241,27 @@
    2.61  				
    2.62  				op->stageFromReady(mService);
    2.63  				op->release();
    2.64 -					
    2.65 +
    2.66 +				++state.mRequestCount;
    2.67  				--needed;
    2.68 +				if (throttle_enabled)
    2.69 +				{
    2.70 +					if (now >= state.mThrottleEnd)
    2.71 +					{
    2.72 +						// Throttle expired, move to next window
    2.73 +						LL_DEBUGS("CoreHttp") << "Throttle expired with " << state.mThrottleLeft
    2.74 +											  << " requests to go and " << state.mRequestCount
    2.75 +											  << " requests issued." << LL_ENDL;
    2.76 +						state.mThrottleLeft = state.mOptions.mThrottleRate;
    2.77 +						state.mThrottleEnd = now + HttpTime(1000000);
    2.78 +					}
    2.79 +					if (--state.mThrottleLeft <= 0)
    2.80 +					{
    2.81 +						goto throttle_on;
    2.82 +					}
    2.83 +				}
    2.84  			}
    2.85 -		
    2.86 +			
    2.87  			// Now go on to the new requests...
    2.88  			while (needed > 0 && ! readyq.empty())
    2.89  			{
    2.90 @@ -231,10 +271,29 @@
    2.91  				op->stageFromReady(mService);
    2.92  				op->release();
    2.93  					
    2.94 +				++state.mRequestCount;
    2.95  				--needed;
    2.96 +				if (throttle_enabled)
    2.97 +				{
    2.98 +					if (now >= state.mThrottleEnd)
    2.99 +					{
   2.100 +						// Throttle expired, move to next window
   2.101 +						LL_DEBUGS("CoreHttp") << "Throttle expired with " << state.mThrottleLeft
   2.102 +											  << " requests to go and " << state.mRequestCount
   2.103 +											  << " requests issued." << LL_ENDL;
   2.104 +						state.mThrottleLeft = state.mOptions.mThrottleRate;
   2.105 +						state.mThrottleEnd = now + HttpTime(1000000);
   2.106 +					}
   2.107 +					if (--state.mThrottleLeft <= 0)
   2.108 +					{
   2.109 +						goto throttle_on;
   2.110 +					}
   2.111 +				}
   2.112  			}
   2.113  		}
   2.114 -				
   2.115 +
   2.116 +	throttle_on:
   2.117 +		
   2.118  		if (! readyq.empty() || ! retryq.empty())
   2.119  		{
   2.120  			// If anything is ready, continue looping...
     3.1 --- a/indra/llcorehttp/_httppolicyclass.cpp	Mon Jul 29 16:26:02 2013 -0400
     3.2 +++ b/indra/llcorehttp/_httppolicyclass.cpp	Tue Jul 30 15:21:31 2013 -0400
     3.3 @@ -36,7 +36,8 @@
     3.4  HttpPolicyClass::HttpPolicyClass()
     3.5  	: mConnectionLimit(HTTP_CONNECTION_LIMIT_DEFAULT),
     3.6  	  mPerHostConnectionLimit(HTTP_CONNECTION_LIMIT_DEFAULT),
     3.7 -	  mPipelining(HTTP_PIPELINING_DEFAULT)
     3.8 +	  mPipelining(HTTP_PIPELINING_DEFAULT),
     3.9 +	  mThrottleRate(HTTP_THROTTLE_RATE_DEFAULT)
    3.10  {}
    3.11  
    3.12  
    3.13 @@ -51,6 +52,7 @@
    3.14  		mConnectionLimit = other.mConnectionLimit;
    3.15  		mPerHostConnectionLimit = other.mPerHostConnectionLimit;
    3.16  		mPipelining = other.mPipelining;
    3.17 +		mThrottleRate = other.mThrottleRate;
    3.18  	}
    3.19  	return *this;
    3.20  }
    3.21 @@ -59,7 +61,8 @@
    3.22  HttpPolicyClass::HttpPolicyClass(const HttpPolicyClass & other)
    3.23  	: mConnectionLimit(other.mConnectionLimit),
    3.24  	  mPerHostConnectionLimit(other.mPerHostConnectionLimit),
    3.25 -	  mPipelining(other.mPipelining)
    3.26 +	  mPipelining(other.mPipelining),
    3.27 +	  mThrottleRate(other.mThrottleRate)
    3.28  {}
    3.29  
    3.30  
    3.31 @@ -79,6 +82,10 @@
    3.32  		mPipelining = llclamp(value, 0L, 1L);
    3.33  		break;
    3.34  
    3.35 +	case HttpRequest::PO_THROTTLE_RATE:
    3.36 +		mThrottleRate = llclamp(value, 0L, 1000000L);
    3.37 +		break;
    3.38 +
    3.39  	default:
    3.40  		return HttpStatus(HttpStatus::LLCORE, HE_INVALID_ARG);
    3.41  	}
    3.42 @@ -103,6 +110,10 @@
    3.43  		*value = mPipelining;
    3.44  		break;
    3.45  
    3.46 +	case HttpRequest::PO_THROTTLE_RATE:
    3.47 +		*value = mThrottleRate;
    3.48 +		break;
    3.49 +
    3.50  	default:
    3.51  		return HttpStatus(HttpStatus::LLCORE, HE_INVALID_ARG);
    3.52  	}
     4.1 --- a/indra/llcorehttp/_httppolicyclass.h	Mon Jul 29 16:26:02 2013 -0400
     4.2 +++ b/indra/llcorehttp/_httppolicyclass.h	Tue Jul 30 15:21:31 2013 -0400
     4.3 @@ -63,6 +63,7 @@
     4.4  	long						mConnectionLimit;
     4.5  	long						mPerHostConnectionLimit;
     4.6  	long						mPipelining;
     4.7 +	long						mThrottleRate;
     4.8  };  // end class HttpPolicyClass
     4.9  
    4.10  }  // end namespace LLCore
     5.1 --- a/indra/llcorehttp/_httpservice.cpp	Mon Jul 29 16:26:02 2013 -0400
     5.2 +++ b/indra/llcorehttp/_httpservice.cpp	Tue Jul 30 15:21:31 2013 -0400
     5.3 @@ -52,7 +52,8 @@
     5.4  	{	false,		true,		true,		false	},		// PO_HTTP_PROXY
     5.5  	{	true,		true,		true,		false	},		// PO_LLPROXY
     5.6  	{	true,		true,		true,		false	},		// PO_TRACE
     5.7 -	{	true,		true,		false,		true	}		// PO_ENABLE_PIPELINING
     5.8 +	{	true,		true,		false,		true	},		// PO_ENABLE_PIPELINING
     5.9 +	{	true,		true,		false,		true	}		// PO_THROTTLE_RATE
    5.10  };
    5.11  HttpService * HttpService::sInstance(NULL);
    5.12  volatile HttpService::EState HttpService::sState(NOT_INITIALIZED);
     6.1 --- a/indra/llcorehttp/httprequest.h	Mon Jul 29 16:26:02 2013 -0400
     6.2 +++ b/indra/llcorehttp/httprequest.h	Tue Jul 30 15:21:31 2013 -0400
     6.3 @@ -139,23 +139,33 @@
     6.4  
     6.5  		/// Limits the number of connections used for a single
     6.6  		/// literal address/port pair within the class.
     6.7 +		///
     6.8 +		/// Per-class only
     6.9  		PO_PER_HOST_CONNECTION_LIMIT,
    6.10  
    6.11  		/// String containing a system-appropriate directory name
    6.12  		/// where SSL certs are stored.
    6.13 +		///
    6.14 +		/// Global only
    6.15  		PO_CA_PATH,
    6.16  
    6.17  		/// String giving a full path to a file containing SSL certs.
    6.18 +		///
    6.19 +		/// Global only
    6.20  		PO_CA_FILE,
    6.21  
    6.22  		/// String of host/port to use as simple HTTP proxy.  This is
    6.23  		/// going to change in the future into something more elaborate
    6.24  		/// that may support richer schemes.
    6.25 +		///
    6.26 +		/// Global only
    6.27  		PO_HTTP_PROXY,
    6.28  
    6.29  		/// Long value that if non-zero enables the use of the
    6.30  		/// traditional LLProxy code for http/socks5 support.  If
    6.31  		// enabled, has priority over GP_HTTP_PROXY.
    6.32 +		///
    6.33 +		/// Global only
    6.34  		PO_LLPROXY,
    6.35  
    6.36  		/// Long value setting the logging trace level for the
    6.37 @@ -169,12 +179,25 @@
    6.38  		/// These values are also used in the trace modes for
    6.39  		/// individual requests in HttpOptions.  Also be aware that
    6.40  		/// tracing tends to impact performance of the viewer.
    6.41 +		///
    6.42 +		/// Global only
    6.43  		PO_TRACE,
    6.44  
    6.45  		/// Suitable requests are allowed to pipeline on their
    6.46  		/// connections when they ask for it.
    6.47 +		///
    6.48 +		/// Per-class only
    6.49  		PO_ENABLE_PIPELINING,
    6.50  
    6.51 +		/// Controls whether client-side throttling should be
    6.52 +		/// performed on this policy class.  Positive values
    6.53 +		/// enable throttling and specify the request rate
    6.54 +		/// (requests per second) that should be targetted.
    6.55 +		/// A value of zero, the default, specifies no throttling.
    6.56 +		///
    6.57 +		/// Per-class only
    6.58 +		PO_THROTTLE_RATE,
    6.59 +		
    6.60  		PO_LAST  // Always at end
    6.61  	};
    6.62  
     7.1 --- a/indra/newview/llappcorehttp.cpp	Mon Jul 29 16:26:02 2013 -0400
     7.2 +++ b/indra/newview/llappcorehttp.cpp	Tue Jul 30 15:21:31 2013 -0400
     7.3 @@ -40,32 +40,33 @@
     7.4  	U32							mMin;
     7.5  	U32							mMax;
     7.6  	U32							mDivisor;
     7.7 +	U32							mRate;
     7.8  	std::string					mKey;
     7.9  	const char *				mUsage;
    7.10  } init_data[] =					//  Default and dynamic values for classes
    7.11  {
    7.12  	{
    7.13 -		LLAppCoreHttp::AP_TEXTURE,			8,		1,		12,		1,
    7.14 +		LLAppCoreHttp::AP_TEXTURE,			8,		1,		12,		1,		0,
    7.15  		"TextureFetchConcurrency",
    7.16  		"texture fetch"
    7.17  	},
    7.18  	{
    7.19 -		LLAppCoreHttp::AP_MESH1,			32,		1,		128,	1,
    7.20 +		LLAppCoreHttp::AP_MESH1,			32,		1,		128,	1,		100,
    7.21  		"MeshMaxConcurrentRequests",
    7.22  		"mesh fetch"
    7.23  	},
    7.24  	{
    7.25 -		LLAppCoreHttp::AP_MESH2,			8,		1,		32,		4,
    7.26 +		LLAppCoreHttp::AP_MESH2,			8,		1,		32,		4,		100,
    7.27  		"MeshMaxConcurrentRequests",
    7.28  		"mesh2 fetch"
    7.29  	},
    7.30  	{
    7.31 -		LLAppCoreHttp::AP_LARGE_MESH,		2,		1,		8,		1,
    7.32 +		LLAppCoreHttp::AP_LARGE_MESH,		2,		1,		8,		1,		0,
    7.33  		"",
    7.34  		"large mesh fetch"
    7.35  	},
    7.36  	{
    7.37 -		LLAppCoreHttp::AP_UPLOADS,			2,		1,		8,		1,
    7.38 +		LLAppCoreHttp::AP_UPLOADS,			2,		1,		8,		1,		0,
    7.39  		"",
    7.40  		"asset upload"
    7.41  	}
    7.42 @@ -267,10 +268,28 @@
    7.43  
    7.44  void LLAppCoreHttp::refreshSettings(bool initial)
    7.45  {
    7.46 +	LLCore::HttpStatus status;
    7.47 +	
    7.48  	for (int i(0); i < LL_ARRAY_SIZE(init_data); ++i)
    7.49  	{
    7.50  		const EAppPolicy policy(init_data[i].mPolicy);
    7.51  
    7.52 +		// Set any desired throttle
    7.53 +		if (initial && init_data[i].mRate)
    7.54 +		{
    7.55 +			// Init-time only, can use the static setters here
    7.56 +			status = LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_THROTTLE_RATE,
    7.57 +																mPolicies[policy],
    7.58 +																init_data[i].mRate,
    7.59 +																NULL);
    7.60 +			if (! status)
    7.61 +			{
    7.62 +				LL_WARNS("Init") << "Unable to set " << init_data[i].mUsage
    7.63 +								 << " throttle rate.  Reason:  " << status.toString()
    7.64 +								 << LL_ENDL;
    7.65 +			}
    7.66 +		}
    7.67 +
    7.68  		// Get target connection concurrency value
    7.69  		U32 setting(init_data[i].mDefault);
    7.70  		if (! init_data[i].mKey.empty() && gSavedSettings.controlExists(init_data[i].mKey))
    7.71 @@ -299,7 +318,7 @@
    7.72  										   setting, NULL);
    7.73  		if (LLCORE_HTTP_HANDLE_INVALID == handle)
    7.74  		{
    7.75 -			LLCore::HttpStatus status(mRequest->getStatus());
    7.76 +			status = mRequest->getStatus();
    7.77  			LL_WARNS("Init") << "Unable to set " << init_data[i].mUsage
    7.78  							 << " concurrency.  Reason:  " << status.toString()
    7.79  							 << LL_ENDL;
     8.1 --- a/indra/newview/llmeshrepository.cpp	Mon Jul 29 16:26:02 2013 -0400
     8.2 +++ b/indra/newview/llmeshrepository.cpp	Tue Jul 30 15:21:31 2013 -0400
     8.3 @@ -229,7 +229,6 @@
     8.4  LLMeshRepository gMeshRepo;
     8.5  
     8.6  const S32 MESH_HEADER_SIZE = 4096;                      // Important:  assumption is that headers fit in this space
     8.7 -const U32 MAX_MESH_REQUESTS_PER_SECOND = 100;
     8.8  const S32 REQUEST_HIGH_WATER_MIN = 32;
     8.9  const S32 REQUEST_HIGH_WATER_MAX = 80;
    8.10  const S32 REQUEST_LOW_WATER_MIN = 16;
    8.11 @@ -613,7 +612,6 @@
    8.12  LLMeshRepoThread::LLMeshRepoThread()
    8.13  : LLThread("mesh repo"),
    8.14    mWaiting(false),
    8.15 -  mHttpRetries(0U),
    8.16    mHttpRequest(NULL),
    8.17    mHttpOptions(NULL),
    8.18    mHttpLargeOptions(NULL),
    8.19 @@ -701,23 +699,9 @@
    8.20  		
    8.21  		if (! LLApp::isQuitting())
    8.22  		{
    8.23 -			static U32 count = 0;
    8.24 -			static F32 last_hundred = gFrameTimeSeconds;
    8.25 -
    8.26 -			if (gFrameTimeSeconds - last_hundred > 1.f)
    8.27 -			{ //a second has gone by, clear count
    8.28 -				last_hundred = gFrameTimeSeconds;
    8.29 -				count = 0;
    8.30 -			}
    8.31 -			else
    8.32 -			{
    8.33 -				count += mHttpRetries;
    8.34 -			}
    8.35 -			mHttpRetries = 0U;
    8.36 +			// NOTE: order of queue processing intentionally favors LOD requests over header requests
    8.37  			
    8.38 -			// NOTE: throttling intentionally favors LOD requests over header requests
    8.39 -			
    8.40 -			while (!mLODReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && mHttpRequestSet.size() < sRequestHighWater)
    8.41 +			while (!mLODReqQ.empty() && mHttpRequestSet.size() < sRequestHighWater)
    8.42  			{
    8.43  				if (! mMutex)
    8.44  				{
    8.45 @@ -728,7 +712,7 @@
    8.46  				mLODReqQ.pop();
    8.47  				LLMeshRepository::sLODProcessing--;
    8.48  				mMutex->unlock();
    8.49 -				if (!fetchMeshLOD(req.mMeshParams, req.mLOD, count))//failed, resubmit
    8.50 +				if (!fetchMeshLOD(req.mMeshParams, req.mLOD))//failed, resubmit
    8.51  				{
    8.52  					mMutex->lock();
    8.53  					mLODReqQ.push(req) ; 
    8.54 @@ -737,7 +721,7 @@
    8.55  				}
    8.56  			}
    8.57  
    8.58 -			while (!mHeaderReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && mHttpRequestSet.size() < sRequestHighWater)
    8.59 +			while (!mHeaderReqQ.empty() && mHttpRequestSet.size() < sRequestHighWater)
    8.60  			{
    8.61  				if (! mMutex)
    8.62  				{
    8.63 @@ -747,7 +731,7 @@
    8.64  				HeaderRequest req = mHeaderReqQ.front();
    8.65  				mHeaderReqQ.pop();
    8.66  				mMutex->unlock();
    8.67 -				if (!fetchMeshHeader(req.mMeshParams, count))//failed, resubmit
    8.68 +				if (!fetchMeshHeader(req.mMeshParams))//failed, resubmit
    8.69  				{
    8.70  					mMutex->lock();
    8.71  					mHeaderReqQ.push(req) ;
    8.72 @@ -762,14 +746,14 @@
    8.73  			// order will lose.  Keep to the throttle enforcement and pay
    8.74  			// attention to the highwater level (enforced in each fetchXXX()
    8.75  			// method).
    8.76 -			if (! mSkinRequests.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && mHttpRequestSet.size() < sRequestHighWater)
    8.77 +			if (! mSkinRequests.empty() && mHttpRequestSet.size() < sRequestHighWater)
    8.78  			{
    8.79  				// *FIXME:  this really does need a lock as do the following ones
    8.80  				std::set<LLUUID> incomplete;
    8.81  				for (std::set<LLUUID>::iterator iter = mSkinRequests.begin(); iter != mSkinRequests.end(); ++iter)
    8.82  				{
    8.83  					LLUUID mesh_id = *iter;
    8.84 -					if (!fetchMeshSkinInfo(mesh_id, count))
    8.85 +					if (!fetchMeshSkinInfo(mesh_id))
    8.86  					{
    8.87  						incomplete.insert(mesh_id);
    8.88  					}
    8.89 @@ -777,13 +761,13 @@
    8.90  				mSkinRequests.swap(incomplete);
    8.91  			}
    8.92  
    8.93 -			if (! mDecompositionRequests.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && mHttpRequestSet.size() < sRequestHighWater)
    8.94 +			if (! mDecompositionRequests.empty() && mHttpRequestSet.size() < sRequestHighWater)
    8.95  			{
    8.96  				std::set<LLUUID> incomplete;
    8.97  				for (std::set<LLUUID>::iterator iter = mDecompositionRequests.begin(); iter != mDecompositionRequests.end(); ++iter)
    8.98  				{
    8.99  					LLUUID mesh_id = *iter;
   8.100 -					if (!fetchMeshDecomposition(mesh_id, count))
   8.101 +					if (!fetchMeshDecomposition(mesh_id))
   8.102  					{
   8.103  						incomplete.insert(mesh_id);
   8.104  					}
   8.105 @@ -791,13 +775,13 @@
   8.106  				mDecompositionRequests.swap(incomplete);
   8.107  			}
   8.108  
   8.109 -			if (! mPhysicsShapeRequests.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && mHttpRequestSet.size() < sRequestHighWater)
   8.110 +			if (! mPhysicsShapeRequests.empty() && mHttpRequestSet.size() < sRequestHighWater)
   8.111  			{
   8.112  				std::set<LLUUID> incomplete;
   8.113  				for (std::set<LLUUID>::iterator iter = mPhysicsShapeRequests.begin(); iter != mPhysicsShapeRequests.end(); ++iter)
   8.114  				{
   8.115  					LLUUID mesh_id = *iter;
   8.116 -					if (!fetchMeshPhysicsShape(mesh_id, count))
   8.117 +					if (!fetchMeshPhysicsShape(mesh_id))
   8.118  					{
   8.119  						incomplete.insert(mesh_id);
   8.120  					}
   8.121 @@ -965,7 +949,7 @@
   8.122  }
   8.123  
   8.124  
   8.125 -bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id, U32& count)
   8.126 +bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
   8.127  {
   8.128  	
   8.129  	if (!mHeaderMutex)
   8.130 @@ -1023,7 +1007,7 @@
   8.131  			}
   8.132  
   8.133  			//reading from VFS failed for whatever reason, fetch from sim
   8.134 -			if (count >= MAX_MESH_REQUESTS_PER_SECOND || mHttpRequestSet.size() >= sRequestHighWater)
   8.135 +			if (mHttpRequestSet.size() >= sRequestHighWater)
   8.136  			{
   8.137  				return false;
   8.138  			}
   8.139 @@ -1060,7 +1044,7 @@
   8.140  	return ret;
   8.141  }
   8.142  
   8.143 -bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id, U32& count)
   8.144 +bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
   8.145  {
   8.146  	if (!mHeaderMutex)
   8.147  	{
   8.148 @@ -1118,7 +1102,7 @@
   8.149  			}
   8.150  
   8.151  			//reading from VFS failed for whatever reason, fetch from sim
   8.152 -			if (count >= MAX_MESH_REQUESTS_PER_SECOND || mHttpRequestSet.size() >= sRequestHighWater)
   8.153 +			if (mHttpRequestSet.size() >= sRequestHighWater)
   8.154  			{
   8.155  				return false;
   8.156  			}
   8.157 @@ -1155,7 +1139,7 @@
   8.158  	return ret;
   8.159  }
   8.160  
   8.161 -bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id, U32& count)
   8.162 +bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
   8.163  {
   8.164  	if (!mHeaderMutex)
   8.165  	{
   8.166 @@ -1212,7 +1196,7 @@
   8.167  			}
   8.168  
   8.169  			//reading from VFS failed for whatever reason, fetch from sim
   8.170 -			if (count >= MAX_MESH_REQUESTS_PER_SECOND || mHttpRequestSet.size() >= sRequestHighWater)
   8.171 +			if (mHttpRequestSet.size() >= sRequestHighWater)
   8.172  			{
   8.173  				return false;
   8.174  			}
   8.175 @@ -1282,7 +1266,7 @@
   8.176  }
   8.177  
   8.178  //return false if failed to get header
   8.179 -bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count)
   8.180 +bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
   8.181  {
   8.182  	{
   8.183  		//look for mesh in asset in vfs
   8.184 @@ -1331,7 +1315,6 @@
   8.185  			handler->mHttpHandle = handle;
   8.186  			mHttpRequestSet.insert(handler);
   8.187  			++LLMeshRepository::sHTTPRequestCount;
   8.188 -			++count;
   8.189  		}
   8.190  	}
   8.191  
   8.192 @@ -1339,7 +1322,7 @@
   8.193  }
   8.194  
   8.195  //return false if failed to get mesh lod.
   8.196 -bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count)
   8.197 +bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
   8.198  {
   8.199  	if (!mHeaderMutex)
   8.200  	{
   8.201 @@ -1413,7 +1396,6 @@
   8.202  					handler->mHttpHandle = handle;
   8.203  					mHttpRequestSet.insert(handler);
   8.204  					++LLMeshRepository::sHTTPRequestCount;
   8.205 -					++count;
   8.206  				}
   8.207  			}
   8.208  			else
   8.209 @@ -2374,11 +2356,8 @@
   8.210  {
   8.211  	mProcessed = true;
   8.212  
   8.213 -	// Accumulate retries, we'll use these to offset the HTTP
   8.214 -	// count and maybe hold to a throttle better.
   8.215  	unsigned int retries(0U);
   8.216  	response->getRetries(NULL, &retries);
   8.217 -	gMeshRepo.mThread->mHttpRetries += retries;
   8.218  	LLMeshRepository::sHTTPRetryCount += retries;
   8.219  
   8.220  	LLCore::HttpStatus status(response->getStatus());
     9.1 --- a/indra/newview/llmeshrepository.h	Mon Jul 29 16:26:02 2013 -0400
     9.2 +++ b/indra/newview/llmeshrepository.h	Tue Jul 30 15:21:31 2013 -0400
     9.3 @@ -322,7 +322,6 @@
     9.4  
     9.5  	// llcorehttp library interface objects.
     9.6  	LLCore::HttpStatus					mHttpStatus;
     9.7 -	unsigned int						mHttpRetries;
     9.8  	LLCore::HttpRequest *				mHttpRequest;
     9.9  	LLCore::HttpOptions *				mHttpOptions;
    9.10  	LLCore::HttpOptions *				mHttpLargeOptions;
    9.11 @@ -345,8 +344,8 @@
    9.12  	void lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
    9.13  	void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
    9.14  
    9.15 -	bool fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count);
    9.16 -	bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count);
    9.17 +	bool fetchMeshHeader(const LLVolumeParams& mesh_params);
    9.18 +	bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
    9.19  	bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size);
    9.20  	bool lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size);
    9.21  	bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size);
    9.22 @@ -363,15 +362,15 @@
    9.23  
    9.24  	//send request for skin info, returns true if header info exists 
    9.25  	//  (should hold onto mesh_id and try again later if header info does not exist)
    9.26 -	bool fetchMeshSkinInfo(const LLUUID& mesh_id, U32& count);
    9.27 +	bool fetchMeshSkinInfo(const LLUUID& mesh_id);
    9.28  
    9.29  	//send request for decomposition, returns true if header info exists 
    9.30  	//  (should hold onto mesh_id and try again later if header info does not exist)
    9.31 -	bool fetchMeshDecomposition(const LLUUID& mesh_id, U32& count);
    9.32 +	bool fetchMeshDecomposition(const LLUUID& mesh_id);
    9.33  
    9.34  	//send request for PhysicsShape, returns true if header info exists 
    9.35  	//  (should hold onto mesh_id and try again later if header info does not exist)
    9.36 -	bool fetchMeshPhysicsShape(const LLUUID& mesh_id, U32& count);
    9.37 +	bool fetchMeshPhysicsShape(const LLUUID& mesh_id);
    9.38  
    9.39  	static void incActiveLODRequests();
    9.40  	static void decActiveLODRequests();

mercurial