From f945415210f0e18c2c6d941fda6b7d45cb0f06f1 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 13 Mar 2013 06:26:25 +0000 Subject: Large changes to the LLCurl::Responder API, as well as pulling in some changes to common libraries from the server codebase: * Additional error checking in http handlers. * Uniform log spam for http errors. * Switch to using constants for http heads and status codes. * Fixed bugs in incorrectly checking if parsing LLSD xml resulted in an error. * Reduced spam regarding LLSD parsing errors in the default completedRaw http handler. It should not longer be necessary to short-circuit completedRaw to avoid spam. * Ported over a few bug fixes from the server code. * Switch mode http status codes to use S32 instead of U32. * Ported LLSD::asStringRef from server code; avoids copying strings all over the place. * Ported server change to LLSD::asBinary; this always returns a reference now instead of copying the entire binary blob. * Ported server pretty notation format (and pretty binary format) to llsd serialization. * The new LLCurl::Responder API no longer has two error handlers to choose from. Overriding the following methods have been deprecated: ** error - use httpFailure ** errorWithContent - use httpFailure ** result - use httpSuccess ** completed - use httpCompleted ** completedHeader - no longer necessary; call getResponseHeaders() from a completion method to obtain these headers. * In order to 'catch' a completed http request, override one of these methods: ** httpSuccess - Called for any 2xx status code. ** httpFailure - Called for any non-2xx status code. ** httpComplete - Called for all status codes. Default implementation is to call either httpSuccess or httpFailure. * It is recommended to keep these methods protected/private in order to avoid triggering of these methods without using a 'push' method (see below). * Uniform error handling should followed whenever possible by calling a variant of this during httpFailure: ** llwarns << dumpResponse() << llendl; * Be sure to include LOG_CLASS(your_class_name) in your class in order for the log entry to give more context. * In order to 'push' a result into the responder, you should no longer call error, errorWithContent, result, or completed. * Nor should you directly call httpSuccess/Failure/Completed (unless passing a message up to a parent class). * Instead, you can set the internal content of a responder and trigger a corresponding method using the following methods: ** successResult - Sets results and calls httpSuccess ** failureResult - Sets results and calls httpFailure ** completedResult - Sets results and calls httpCompleted * To obtain information about a the response from a reponder method, use the following getters: ** getStatus - HTTP status code ** getReason - Reason string ** getContent - Content (Parsed body LLSD) ** getResponseHeaders - Response Headers (LLSD map) ** getHTTPMethod - HTTP method of the request ** getURL - URL of the request * It is still possible to override completeRaw if you want to manipulate data directly out of LLPumpIO. * See indra/llmessage/llcurl.h for more information. --- indra/newview/llviewerregion.cpp | 104 ++++++++++++++++++++++++--------------- 1 file changed, 63 insertions(+), 41 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index b8b53aa6e4..2286bb09e1 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -204,24 +204,30 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder { LOG_CLASS(BaseCapabilitiesComplete); public: - BaseCapabilitiesComplete(U64 region_handle, S32 id) + BaseCapabilitiesComplete(U64 region_handle, S32 id) : mRegionHandle(region_handle), mID(id) - { } + { } virtual ~BaseCapabilitiesComplete() { } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) - { - LL_WARNS2("AppInit", "Capabilities") << "[status:" << statusNum << ":] " << content << LL_ENDL; + static BaseCapabilitiesComplete* build( U64 region_handle, S32 id ) + { + return new BaseCapabilitiesComplete(region_handle, id); + } + +private: + /* virtual */void httpFailure() + { + LL_WARNS2("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { regionp->failedSeedCapability(); } - } + } - void result(const LLSD& content) - { + /* virtual */ void httpSuccess() + { LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if(!regionp) //region was removed { @@ -234,11 +240,17 @@ public: return ; } + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLSD::map_const_iterator iter; 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; @@ -257,11 +269,6 @@ public: } } - static BaseCapabilitiesComplete* build( U64 region_handle, S32 id ) - { - return new BaseCapabilitiesComplete(region_handle, id); - } - private: U64 mRegionHandle; S32 mID; @@ -278,19 +285,32 @@ public: virtual ~BaseCapabilitiesCompleteTracker() { } - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) + static BaseCapabilitiesCompleteTracker* build( U64 region_handle ) + { + return new BaseCapabilitiesCompleteTracker( region_handle ); + } + +private: + /* virtual */ void httpFailure() { - llwarns << "BaseCapabilitiesCompleteTracker error [status:" - << statusNum << "]: " << content << llendl; + llwarns << dumpResponse() << llendl; } - void result(const LLSD& content) + /* virtual */ void httpSuccess() { LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if( !regionp ) { + LL_WARNS2("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; return ; - } + } + + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } LLSD::map_const_iterator iter; for(iter = content.beginMap(); iter != content.endMap(); ++iter) { @@ -300,7 +320,8 @@ public: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - llinfos<<"BaseCapabilitiesCompleteTracker "<<"Sim sent duplicate seed caps that differs in size - most likely content."<getRegionImpl()->mCapabilities.begin(); while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) @@ -311,16 +332,11 @@ public: */ regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); } - } - static BaseCapabilitiesCompleteTracker* build( U64 region_handle ) - { - return new BaseCapabilitiesCompleteTracker( region_handle ); - } private: - U64 mRegionHandle; + U64 mRegionHandle; }; @@ -1728,31 +1744,37 @@ class SimulatorFeaturesReceived : public LLHTTPClient::Responder { LOG_CLASS(SimulatorFeaturesReceived); public: - SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, + SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) - : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts) - { } - - - void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content) - { - LL_WARNS2("AppInit", "SimulatorFeatures") << "[status:" << statusNum << "]: " << content << LL_ENDL; + : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts) + { } + +private: + /* virtual */ void httpFailure() + { + LL_WARNS2("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; retry(); - } + } - void result(const LLSD& content) - { + /* virtual */ void httpSuccess() + { LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if(!regionp) //region is removed or responder is not created. { - LL_WARNS2("AppInit", "SimulatorFeatures") << "Received results for region that no longer exists!" << LL_ENDL; + LL_WARNS2("AppInit", "SimulatorFeatures") + << "Received results for region that no longer exists!" << LL_ENDL; return ; } - + + const LLSD& content = getContent(); + if (!content.isMap()) + { + failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); + return; + } regionp->setSimulatorFeatures(content); } -private: void retry() { if (mAttempt < mMaxAttempts) @@ -1762,7 +1784,7 @@ private: LLHTTPClient::get(mRetryURL, new SimulatorFeaturesReceived(*this), LLSD(), CAP_REQUEST_TIMEOUT); } } - + std::string mRetryURL; U64 mRegionHandle; S32 mAttempt; -- cgit v1.2.3 From cfd35b8b22e8043ab14c57f6ee6108cea471a1ab Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Thu, 28 Mar 2013 18:07:54 -0400 Subject: Made a bug that was masking the warning about mismatched caps coming from a region. They could never match because certain capabilities are explicitly not stored when we receive them. * Made mSecondCapabilitiesTracker set capabilities in a way that more closely matches mCapabilities so that they will match up when we get a second cap grant from a region if the caps that were sent are actually the same. * Added more logging around setting a region's seed capability. * Also added a static function in llviewerregion to dump out a CapabilityMap based on the logActiveCapabilities method. Defined the old method in terms of the new static free function. --- indra/newview/llviewerregion.cpp | 81 +++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 21 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2286bb09e1..223f754c2e 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -87,6 +87,8 @@ const S32 MAX_CAP_REQUEST_ATTEMPTS = 30; typedef std::map CapabilityMap; +static void logCapabilities(const CapabilityMap &capmap); + class LLViewerRegionImpl { public: LLViewerRegionImpl(LLViewerRegion * region, LLHost const & host) @@ -321,17 +323,36 @@ private: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { LL_WARNS2("AppInit", "Capabilities") - << "Sim sent duplicate seed caps that differs in size - most likely content." << LL_ENDL; - //todo#add cap debug versus original check? - /*CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); - while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) - { - llinfos<<"BaseCapabilitiesCompleteTracker Original "<first<<" "<< iter->second<getRegionImpl()->mCapabilities.size() + << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() + << LL_ENDL; + + //LL_WARNS2("AppInit", "Capabilities") + // << "Initial Base capabilities: " << LL_ENDL; + + //logCapabilities(regionp->getRegionImpl()->mCapabilities); + + //LL_WARNS2("AppInit", "Capabilities") + // << "Latest base capabilities: " << LL_ENDL; + + //logCapabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); + + // *TODO + //add cap debug versus original check? + //CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); + //while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) + //{ + // llinfos<<"BaseCapabilitiesCompleteTracker Original "<first<<" "<< iter->second<getRegionImplNC()->mSecondCapabilitiesTracker.clear(); } + else + { + LL_DEBUGS("CrossingCaps") << "Sim sent multiple base cap grants with matching sizes." << LL_ENDL; + } } @@ -1671,7 +1692,9 @@ void LLViewerRegion::setSeedCapability(const std::string& url) { if (getCapability("Seed") == url) { - //llwarns << "Ignoring duplicate seed capability" << llendl; + setCapabilityDebug("Seed", url); + LL_DEBUGS("CrossingCaps") << "Received duplicate seed capability, posting to seed " << + url << 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(); @@ -1821,7 +1844,16 @@ 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; + // Continue to not add certain caps, as we do in setCapability. This is so they match up when we check them later. + if ( ! ( name == "EventQueueGet" || name == "UntrustedSimulatorMessage" || name == "SimulatorFeatures" ) ) + { + mImpl->mSecondCapabilitiesTracker[name] = url; + if(name == "GetTexture") + { + mHttpUrl = url ; + } + } + } bool LLViewerRegion::isSpecialCapabilityName(const std::string &name) @@ -1872,16 +1904,7 @@ boost::signals2::connection LLViewerRegion::setCapabilitiesReceivedCallback(cons void LLViewerRegion::logActiveCapabilities() const { - int count = 0; - CapabilityMap::const_iterator iter; - for (iter = mImpl->mCapabilities.begin(); iter != mImpl->mCapabilities.end(); ++iter, ++count) - { - if (!iter->second.empty()) - { - llinfos << iter->first << " URL is " << iter->second << llendl; - } - } - llinfos << "Dumped " << count << " entries." << llendl; + logCapabilities(mImpl->mCapabilities); } LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) @@ -1965,3 +1988,19 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean()); } +/* Static Functions */ + +void logCapabilities(const CapabilityMap &capmap) +{ + S32 count = 0; + CapabilityMap::const_iterator iter; + for (iter = capmap.begin(); iter != capmap.end(); ++iter, ++count) + { + if (!iter->second.empty()) + { + llinfos << "logCapabilities: " << iter->first << " URL is " << iter->second << llendl; + } + } + llinfos << "logCapabilities: Dumped " << count << " entries." << llendl; +} + -- cgit v1.2.3 From 9927963ac9d7ef19db96e8d5ffa04c04d0e3b803 Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Mon, 1 Apr 2013 20:10:39 -0400 Subject: If we get more caps from a subsequent grant for a region, go ahead and use them. This is a hack that should be safe to remove after SH-3895 is fixed everywhere on the sim side. --- indra/newview/llviewerregion.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 223f754c2e..f4b6ff318b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -347,12 +347,23 @@ private: // ++iter; //} - regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); + if (regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() > regionp->getRegionImpl()->mCapabilities.size() ) + { + // *HACK Since we were granted more base capabilities in this grant request than the initial, replace + // the old with the new. This shouldn't happen i.e. we should always get the same capabilities from a + // sim. The simulator fix from SH-3895 should prevent it from happening, at least in the case of the + // inventory api capability grants. + + // Need to clear a std::map before copying into it because old keys take precedence. + regionp->getRegionImplNC()->mCapabilities.clear(); + regionp->getRegionImplNC()->mCapabilities = regionp->getRegionImpl()->mSecondCapabilitiesTracker; + } } else { LL_DEBUGS("CrossingCaps") << "Sim sent multiple base cap grants with matching sizes." << LL_ENDL; } + regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear(); } -- cgit v1.2.3 From 557adcabb925acbcc79f39f76f7cb74b6202a8da Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Tue, 2 Apr 2013 19:51:45 +0000 Subject: Renamed logCapabilites static function to log_capabilities in llviewerregion.cpp to better match coding standard. --- indra/newview/llviewerregion.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f4b6ff318b..f0d81c599c 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -87,7 +87,7 @@ const S32 MAX_CAP_REQUEST_ATTEMPTS = 30; typedef std::map CapabilityMap; -static void logCapabilities(const CapabilityMap &capmap); +static void log_capabilities(const CapabilityMap &capmap); class LLViewerRegionImpl { public: @@ -331,12 +331,12 @@ private: //LL_WARNS2("AppInit", "Capabilities") // << "Initial Base capabilities: " << LL_ENDL; - //logCapabilities(regionp->getRegionImpl()->mCapabilities); + //log_capabilities(regionp->getRegionImpl()->mCapabilities); //LL_WARNS2("AppInit", "Capabilities") // << "Latest base capabilities: " << LL_ENDL; - //logCapabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); + //log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); // *TODO //add cap debug versus original check? @@ -1915,7 +1915,7 @@ boost::signals2::connection LLViewerRegion::setCapabilitiesReceivedCallback(cons void LLViewerRegion::logActiveCapabilities() const { - logCapabilities(mImpl->mCapabilities); + log_capabilities(mImpl->mCapabilities); } LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) @@ -2001,7 +2001,7 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const /* Static Functions */ -void logCapabilities(const CapabilityMap &capmap) +void log_capabilities(const CapabilityMap &capmap) { S32 count = 0; CapabilityMap::const_iterator iter; @@ -2009,9 +2009,9 @@ void logCapabilities(const CapabilityMap &capmap) { if (!iter->second.empty()) { - llinfos << "logCapabilities: " << iter->first << " URL is " << iter->second << llendl; + llinfos << "log_capabilities: " << iter->first << " URL is " << iter->second << llendl; } } - llinfos << "logCapabilities: Dumped " << count << " entries." << llendl; + llinfos << "log_capabilities: Dumped " << count << " entries." << llendl; } -- cgit v1.2.3 From 17af76fae18e305d0a42192a326648f00c84d1f3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 18 Apr 2013 13:56:16 -0400 Subject: SH-4128 WIP - use the AISv3 inventory cap when available for cof link deletion, hook in to callback mechanism so all link operations should be done before outfit is worn. --- indra/newview/llviewerregion.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f0d81c599c..e77b29aca4 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1641,6 +1641,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("FetchInventory2"); capabilityNames.append("FetchInventoryDescendents2"); capabilityNames.append("IncrementCOFVersion"); + capabilityNames.append("InventoryAPIv3"); } capabilityNames.append("GetDisplayNames"); -- cgit v1.2.3 From 9552f733ef0b581158665a1a464b5be7d4bada2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 31 May 2013 13:54:32 -0400 Subject: SH-3635 WIP --- indra/newview/llviewerregion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e77b29aca4..b635087d66 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1877,7 +1877,7 @@ std::string LLViewerRegion::getCapability(const std::string& name) const { if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia"))) { - llwarns << "getCapability called before caps received" << llendl; + llwarns << "getCapability called before caps received for " << name << llendl; } CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); -- cgit v1.2.3 From c67db8e75511de879c69de0faf06a88ac3cc731d Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Mon, 17 Jun 2013 18:52:03 -0400 Subject: SH-4274 FIX Adding RegionHandshakeReply flags for SSA Adding a flag to hint to the sim that this viewer knows how to handle AvatarAppearance messages for self in SSA-enabled regions. --- indra/newview/llviewerregion.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index b8b53aa6e4..48c050f403 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1568,7 +1568,11 @@ void LLViewerRegion::unpackRegionHandshake() msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("RegionInfo"); - msg->addU32("Flags", 0x0 ); + + U32 flags = 0; + flags |= REGION_HANDSHAKE_SUPPORTS_SELF_APPEARANCE; + + msg->addU32("Flags", flags ); msg->sendReliable(host); } -- cgit v1.2.3 From a85fa3b10a406218cabfecc0d592e816f8dfdb53 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 11 Jul 2013 15:15:04 -0700 Subject: Adding support for COPY methods to httpclient. Implementing viewer-side use of AISv3 COPY library folder operation. (SH-4304) --- indra/newview/llviewerregion.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index dca1a5b542..ad046accd0 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -30,6 +30,7 @@ // linden libraries #include "indra_constants.h" +#include "llaisapi.h" #include "llavatarnamecache.h" // name lookup cap url #include "llfloaterreg.h" #include "llmath.h" @@ -1645,7 +1646,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("FetchInventory2"); capabilityNames.append("FetchInventoryDescendents2"); capabilityNames.append("IncrementCOFVersion"); - capabilityNames.append("InventoryAPIv3"); + AISCommand::getCapabilityNames(capabilityNames); } capabilityNames.append("GetDisplayNames"); @@ -1893,6 +1894,22 @@ std::string LLViewerRegion::getCapability(const std::string& name) const return iter->second; } +bool LLViewerRegion::isCapabilityAvailable(const std::string& name) const +{ + if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia"))) + { + llwarns << "isCapabilityAvailable called before caps received for " << name << llendl; + } + + CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); + if(iter == mImpl->mCapabilities.end()) + { + return false; + } + + return true; +} + bool LLViewerRegion::capabilitiesReceived() const { return mCapabilitiesReceived; -- cgit v1.2.3 From 0e8a966f3ba6db8a789b8053bc0eb70584c526fd Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Thu, 8 Aug 2013 17:13:53 -0400 Subject: Moved commented out capabilities debugging code into ifdef'd block and added a comment describing the use of it. --- indra/newview/llviewerregion.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index ad046accd0..7150089380 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -76,6 +76,11 @@ #pragma warning(disable:4355) #endif +// When we receive a base grant of capabilities that has a different number of +// capabilities than the original base grant received for the region, print +// out the two lists of capabilities for analysis. +//#define DEBUG_CAPS_GRANTS + const F32 WATER_TEXTURE_SCALE = 8.f; // Number of times to repeat the water texture across a region const S16 MAX_MAP_DIST = 10; // The server only keeps our pending agent info for 60 seconds. @@ -328,25 +333,18 @@ private: << "mCapabilities == " << regionp->getRegionImpl()->mCapabilities.size() << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() << LL_ENDL; +#ifdef DEBUG_CAPS_GRANTS + LL_WARNS2("AppInit", "Capabilities") + << "Initial Base capabilities: " << LL_ENDL; - //LL_WARNS2("AppInit", "Capabilities") - // << "Initial Base capabilities: " << LL_ENDL; - - //log_capabilities(regionp->getRegionImpl()->mCapabilities); + log_capabilities(regionp->getRegionImpl()->mCapabilities); - //LL_WARNS2("AppInit", "Capabilities") - // << "Latest base capabilities: " << LL_ENDL; + LL_WARNS2("AppInit", "Capabilities") + << "Latest base capabilities: " << LL_ENDL; - //log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); + log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); - // *TODO - //add cap debug versus original check? - //CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); - //while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) - //{ - // llinfos<<"BaseCapabilitiesCompleteTracker Original "<first<<" "<< iter->second<getRegionImpl()->mSecondCapabilitiesTracker.size() > regionp->getRegionImpl()->mCapabilities.size() ) { -- cgit v1.2.3 From 19ba8d8413c4541da2d76656776545334a09a38f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 24 Sep 2013 15:39:43 -0400 Subject: SH-3455 WIP - removed some handling for appearance version < 1 --- indra/newview/llviewerregion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7150089380..814b5e2265 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -387,7 +387,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mSimAccess( SIM_ACCESS_MIN ), mBillableFactor(1.0), mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT), - mCentralBakeVersion(0), + mCentralBakeVersion(1), mClassID(0), mCPURatio(0), mColoName("unknown"), -- cgit v1.2.3 From cc9a7a70b1971def1c53c70c96e8ce88fc5a7b86 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 17 Dec 2013 14:14:03 -0500 Subject: merge fix --- indra/newview/llviewerregion.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index fa7af4f48e..e6cc75f1ce 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1673,6 +1673,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("ProductInfoRequest"); capabilityNames.append("ProvisionVoiceAccountRequest"); capabilityNames.append("RemoteParcelRequest"); + capabilityNames.append("RenderMaterials"); capabilityNames.append("RequestTextureDownload"); capabilityNames.append("ResourceCostSelected"); capabilityNames.append("RetrieveNavMeshSrc"); -- cgit v1.2.3 From 487ca1bad37883be0325b564ab557a8f77575388 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 May 2014 17:50:59 -0400 Subject: v-r -> s-e merge WIP --- indra/newview/llviewerregion.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewerregion.cpp') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7e22b65d4c..fd5df9b774 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -250,7 +250,7 @@ public: private: /* virtual */void httpFailure() { - LL_WARNS2("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; + LL_WARNS("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { @@ -326,7 +326,7 @@ public: private: /* virtual */ void httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; } /* virtual */ void httpSuccess() @@ -334,7 +334,7 @@ private: LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if( !regionp ) { - LL_WARNS2("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; + LL_WARNS("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; return ; } @@ -353,18 +353,18 @@ private: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Sim sent duplicate base caps that differ in size from what we initially received - most likely content. " << "mCapabilities == " << regionp->getRegionImpl()->mCapabilities.size() << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() << LL_ENDL; #ifdef DEBUG_CAPS_GRANTS - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Initial Base capabilities: " << LL_ENDL; log_capabilities(regionp->getRegionImpl()->mCapabilities); - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Latest base capabilities: " << LL_ENDL; log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); @@ -2809,14 +2809,13 @@ class SimulatorFeaturesReceived : public LLHTTPClient::Responder LOG_CLASS(SimulatorFeaturesReceived); public: SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, - S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) -<<<<<<< local + S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts) { } /* virtual */ void httpFailure() { - LL_WARNS2("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; + LL_WARNS("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; retry(); } @@ -2922,7 +2921,7 @@ bool LLViewerRegion::isCapabilityAvailable(const std::string& name) const { if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia"))) { - llwarns << "isCapabilityAvailable called before caps received for " << name << llendl; + LL_WARNS() << "isCapabilityAvailable called before caps received for " << name << LL_ENDL; } CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); @@ -3063,10 +3062,10 @@ void log_capabilities(const CapabilityMap &capmap) { if (!iter->second.empty()) { - llinfos << "log_capabilities: " << iter->first << " URL is " << iter->second << llendl; + LL_INFOS() << "log_capabilities: " << iter->first << " URL is " << iter->second << LL_ENDL; } } - llinfos << "log_capabilities: Dumped " << count << " entries." << llendl; + LL_INFOS() << "log_capabilities: Dumped " << count << " entries." << LL_ENDL; } void LLViewerRegion::resetMaterialsCapThrottle() { -- cgit v1.2.3