summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2013-02-28 10:56:12 -0500
committerprep <prep@lindenlab.com>2013-02-28 10:56:12 -0500
commit03b51b779fd545e63b6f2fa2ef5ba28f21f1ae62 (patch)
tree61989e38aa46f3ee9cb4a84372f865c0b2b97839 /indra/newview/llviewerregion.cpp
parentb6f814af25a957e71dc8d9dd314ac15e3cbe6cd9 (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"
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-xindra/newview/llviewerregion.cpp70
1 files changed, 65 insertions, 5 deletions
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";