summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rw-r--r--indra/newview/llviewerregion.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 0f409701d1..3c2ebc9fef 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -95,8 +95,6 @@
// The server only keeps our pending agent info for 60 seconds.
// We want to allow for seed cap retry, but its not useful after that 60 seconds.
-// Give it 3 chances, each at 18 seconds to give ourselves a few seconds to connect anyways if we give up.
-const S32 MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN = 3;
// Even though we gave up on login, keep trying for caps after we are logged in:
const S32 MAX_CAP_REQUEST_ATTEMPTS = 30;
const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
@@ -178,7 +176,6 @@ public:
mCompositionp(NULL),
mEventPoll(NULL),
mSeedCapMaxAttempts(MAX_CAP_REQUEST_ATTEMPTS),
- mSeedCapMaxAttemptsBeforeLogin(MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN),
mSeedCapAttempts(0),
mHttpResponderID(0),
mLastCameraUpdate(0),
@@ -231,7 +228,6 @@ public:
LLEventPoll* mEventPoll;
S32 mSeedCapMaxAttempts;
- S32 mSeedCapMaxAttemptsBeforeLogin;
S32 mSeedCapAttempts;
S32 mHttpResponderID;
@@ -279,23 +275,17 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
if (url.empty())
{
LL_WARNS("AppInit", "Capabilities") << "Failed to get seed capabilities, and can not determine url!" << LL_ENDL;
+ regionp->setCapabilitiesError();
return; // this error condition is not recoverable.
}
// record that we just entered a new region
newRegionEntry(*regionp);
- // After a few attempts, continue login. But keep trying to get the caps:
- if (mSeedCapAttempts >= mSeedCapMaxAttemptsBeforeLogin &&
- STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
- {
- LLStartUp::setStartupState(STATE_SEED_CAP_GRANTED);
- }
-
if (mSeedCapAttempts > mSeedCapMaxAttempts)
{
- // *TODO: Give a user pop-up about this error?
LL_WARNS("AppInit", "Capabilities") << "Failed to get seed capabilities from '" << url << "' after " << mSeedCapAttempts << " attempts. Giving up!" << LL_ENDL;
+ regionp->setCapabilitiesError();
return; // this error condition is not recoverable.
}
@@ -377,11 +367,6 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
<< " region name " << regionp->getName() << LL_ENDL;
regionp->setCapabilitiesReceived(true);
- if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
- {
- LLStartUp::setStartupState(STATE_SEED_CAP_GRANTED);
- }
-
break;
}
while (true);
@@ -419,6 +404,11 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
if (url.empty())
{
LL_WARNS("AppInit", "Capabilities") << "Failed to get seed capabilities, and can not determine url!" << LL_ENDL;
+ if (regionp->getCapability("Seed").empty())
+ {
+ // initial attempt failed to get this cap as well
+ regionp->setCapabilitiesError();
+ }
break; // this error condition is not recoverable.
}
@@ -598,7 +588,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mCacheLoaded(FALSE),
mCacheDirty(FALSE),
mReleaseNotesRequested(FALSE),
- mCapabilitiesReceived(false),
+ mCapabilitiesState(CAPABILITIES_STATE_INIT),
mSimulatorFeaturesReceived(false),
mBitsReceived(0.f),
mPacketsReceived(0.f),
@@ -3195,12 +3185,17 @@ bool LLViewerRegion::isCapabilityAvailable(const std::string& name) const
bool LLViewerRegion::capabilitiesReceived() const
{
- return mCapabilitiesReceived;
+ return mCapabilitiesState == CAPABILITIES_STATE_RECEIVED;
+}
+
+bool LLViewerRegion::capabilitiesError() const
+{
+ return mCapabilitiesState == CAPABILITIES_STATE_ERROR;
}
void LLViewerRegion::setCapabilitiesReceived(bool received)
{
- mCapabilitiesReceived = received;
+ mCapabilitiesState = received ? CAPABILITIES_STATE_RECEIVED : CAPABILITIES_STATE_INIT;
// Tell interested parties that we've received capabilities,
// so that they can safely use getCapability().
@@ -3215,6 +3210,11 @@ void LLViewerRegion::setCapabilitiesReceived(bool received)
}
}
+void LLViewerRegion::setCapabilitiesError()
+{
+ mCapabilitiesState = CAPABILITIES_STATE_ERROR;
+}
+
boost::signals2::connection LLViewerRegion::setCapabilitiesReceivedCallback(const caps_received_signal_t::slot_type& cb)
{
return mCapabilitiesReceivedSignal.connect(cb);