diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-02-28 13:56:52 -0500 | 
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-02-28 13:56:52 -0500 | 
| commit | cd0b089bb07ecbad995a501b92451b22b0f5ee06 (patch) | |
| tree | 132597db5de1b658b37fa213fb3e74a6dbc65383 | |
| parent | c14b43b5bf21365573608a4bac98b99cddd61d4d (diff) | |
| parent | f92a830730b8acf8930a439ed874f27f77102260 (diff) | |
merge
| -rw-r--r--[-rwxr-xr-x] | indra/llcommon/llsdutil.cpp | 0 | ||||
| -rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.cpp | 28 | ||||
| -rw-r--r--[-rwxr-xr-x] | indra/newview/llstartup.cpp | 0 | ||||
| -rwxr-xr-x | indra/newview/llviewerregion.cpp | 72 | ||||
| -rw-r--r-- | indra/newview/llviewerregion.h | 5 | 
5 files changed, 86 insertions, 19 deletions
| diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 803417d368..803417d368 100755..100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index eb92902de9..024d34519f 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -564,7 +564,6 @@ BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat  {  	return (std::find(mRecursiveCatUUIDs.begin(),mRecursiveCatUUIDs.end(), cat_id) != mRecursiveCatUUIDs.end());  } -  // Bundle up a bunch of requests to send all at once.  // static     void LLInventoryModelBackgroundFetch::bulkFetch() @@ -687,20 +686,23 @@ void LLInventoryModelBackgroundFetch::bulkFetch()  	{  		if (folder_count)  		{ -			std::string url = region->getCapability("FetchInventoryDescendents2");    -			mFetchCount++; -			if (folder_request_body["folders"].size()) -			{ -				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats); -				LLHTTPClient::post(url, folder_request_body, fetcher, 300.0); -			} -			if (folder_request_body_lib["folders"].size()) +			std::string url = region->getCapability("FetchInventoryDescendents2");   			 +			if ( !url.empty() )  			{ -				std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2"); +				mFetchCount++; +				if (folder_request_body["folders"].size()) +				{ +					LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats); +					LLHTTPClient::post(url, folder_request_body, fetcher, 300.0); +				} +				if (folder_request_body_lib["folders"].size()) +				{ +					std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2"); -				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats); -				LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0); -			} +					LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats); +					LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0); +				} +			}					  		}  		if (item_count)  		{ diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 717f578ddb..717f578ddb 100755..100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 684c660e90..9a1c5f89ef 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -142,7 +142,8 @@ public:  	LLUUID mCacheID;  	CapabilityMap mCapabilities; -	 +	CapabilityMap mSecondCapabilitiesTracker;  +  	LLEventPoll* mEventPoll;  	S32 mSeedCapMaxAttempts; @@ -219,7 +220,7 @@ public:  		}      } -    void result(const LLSD& content) +   void result(const LLSD& content)      {  		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);  		if(!regionp) //region was removed @@ -237,6 +238,7 @@ public:  		for(iter = content.beginMap(); iter != content.endMap(); ++iter)  		{  			regionp->setCapability(iter->first, iter->second); +			  			LL_DEBUGS2("AppInit", "Capabilities") << "got capability for "   				<< iter->first << LL_ENDL; @@ -265,6 +267,53 @@ private:  	S32 mID;  }; +class BaseCapabilitiesCompleteTracker :  public LLHTTPClient::Responder +{ +	LOG_CLASS(BaseCapabilitiesCompleteTracker); +public: +	BaseCapabilitiesCompleteTracker( U64 region_handle, S32 id ) +	: mRegionHandle(region_handle), mID(id) +	{ } +	 +	virtual ~BaseCapabilitiesCompleteTracker() +	{ } + +	void error(U32 statusNum, const std::string& reason) +	{ } + +	void result(const LLSD& content) +	{ +		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); +		if(!regionp || mID != regionp->getHttpResponderID()) +		{			 +			return ; +		}		 +		LLSD::map_const_iterator iter; +		for(iter = content.beginMap(); iter != content.endMap(); ++iter) +		{ +			regionp->setCapabilityDebug(iter->first, iter->second);		 +		} +		 +		if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) +		{ +			llwarns<<"Sim sent duplicate seed caps that differs in size - most likely content."<<llendl;			 +			//todo#add cap debug versus original check? +			regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); +		} + +	} + +	static BaseCapabilitiesCompleteTracker* build( U64 region_handle, S32 id ) +	{ +		return new BaseCapabilitiesCompleteTracker( region_handle, id ); +	} + +private: +	U64 mRegionHandle; +	S32 mID; + +}; +  LLViewerRegion::LLViewerRegion(const U64 &handle,  							   const LLHost &host, @@ -1529,7 +1578,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)  	capabilityNames.append("EventQueueGet");  	if (gSavedSettings.getBOOL("UseHTTPInventory")) -	{ +	{	  		capabilityNames.append("FetchLib2");  		capabilityNames.append("FetchLibDescendents2");  		capabilityNames.append("FetchInventory2"); @@ -1596,8 +1645,16 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)  void LLViewerRegion::setSeedCapability(const std::string& url)  {  	if (getCapability("Seed") == url) -    { -		// llwarns << "Ignoring duplicate seed capability" << llendl; +    {	 +		//llwarns << "Ignoring duplicate seed capability" << llendl; +		//Instead of just returning we build up a second set of seed caps and compare them  +		//to the "original" seed cap received and determine why there is problem! +		LLSD capabilityNames = LLSD::emptyArray(); +		mImpl->buildCapabilityNames( capabilityNames ); +		S32 responderID = mImpl->mHttpResponderID+1; + +		LLHTTPClient::post( url, capabilityNames, BaseCapabilitiesCompleteTracker::build(getHandle(), responderID ), +							LLSD(), CAP_REQUEST_TIMEOUT );  		return;      } @@ -1733,6 +1790,11 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u  	}  } +void LLViewerRegion::setCapabilityDebug(const std::string& name, const std::string& url) +{ +	mImpl->mSecondCapabilitiesTracker[name] = url; +} +  bool LLViewerRegion::isSpecialCapabilityName(const std::string &name)  {  	return name == "EventQueueGet" || name == "UntrustedSimulatorMessage"; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 20d96ad9ac..b5fe4677b7 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -241,6 +241,7 @@ public:  	void failedSeedCapability();  	S32 getNumSeedCapRetries();  	void setCapability(const std::string& name, const std::string& url); +	void setCapabilityDebug(const std::string& name, const std::string& url);  	// implements LLCapabilityProvider      virtual std::string getCapability(const std::string& name) const; @@ -339,7 +340,9 @@ public:  	void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );  	void getNeighboringRegionsStatus( std::vector<S32>& regions ); -	 +	const LLViewerRegionImpl * getRegionImpl() const { return mImpl; } +	LLViewerRegionImpl * getRegionImplNC() { return mImpl; } +  public:  	struct CompareDistance  	{ | 
