diff options
author | prep <prep@lindenlab.com> | 2013-02-28 10:56:12 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2013-02-28 10:56:12 -0500 |
commit | 03b51b779fd545e63b6f2fa2ef5ba28f21f1ae62 (patch) | |
tree | 61989e38aa46f3ee9cb4a84372f865c0b2b97839 | |
parent | b6f814af25a957e71dc8d9dd314ac15e3cbe6cd9 (diff) |
SH-3895. Added code to recognize if the second incoming regions seed caps differ in size from the initial region caps. Also avoid starting a inventory fetch responder if the requisite cap is missing"
-rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.cpp | 28 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 70 | ||||
-rw-r--r-- | indra/newview/llviewerregion.h | 5 |
3 files changed, 84 insertions, 19 deletions
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/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index d60ec04578..db5bba89e2 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 BaseCapabilitiesCompleteDebug : public LLHTTPClient::Responder +{ + LOG_CLASS(BaseCapabilitiesCompleteDebug); +public: + BaseCapabilitiesCompleteDebug( U64 region_handle, S32 id ) + : mRegionHandle(region_handle), mID(id) + { } + + virtual ~BaseCapabilitiesCompleteDebug() + { } + + 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 differ in size - most likely content."<<llendl; + //todo#add cap debug versus original check? + regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); + } + + } + + static BaseCapabilitiesCompleteDebug* build( U64 region_handle, S32 id ) + { + return new BaseCapabilitiesCompleteDebug( 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"); @@ -1595,8 +1644,14 @@ 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 ); + LLHTTPClient::post( url, capabilityNames, BaseCapabilitiesCompleteDebug::build(getHandle(), ++mImpl->mHttpResponderID ), + LLSD(), CAP_REQUEST_TIMEOUT ); return; } @@ -1732,6 +1787,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 { |