diff options
author | Dave Parks <davep@lindenlab.com> | 2011-07-14 01:07:26 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-07-14 01:07:26 -0500 |
commit | 4e61870f3af1ab87d0d0e1e9c2024636b8fe68d3 (patch) | |
tree | ff9ec9cd14e7869c1a8c88246f34b1658ca4ab7f /indra/newview/llviewerregion.cpp | |
parent | dd3069127bb437e95d106734e8a0ab95307e297c (diff) | |
parent | 561d40d5c316b4879ea56965f6b320e8e1c70a88 (diff) |
merge
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rw-r--r-- | indra/newview/llviewerregion.cpp | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 1d07960937..5b7492b66f 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -186,8 +186,8 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder { LOG_CLASS(BaseCapabilitiesComplete); public: - BaseCapabilitiesComplete(LLViewerRegion* region) - : mRegion(region) + BaseCapabilitiesComplete(LLViewerRegion* region, S32 retry = 0) + : mRegion(region), mRetry(retry) { } virtual ~BaseCapabilitiesComplete() { @@ -206,9 +206,24 @@ public: { LL_WARNS2("AppInit", "Capabilities") << statusNum << ": " << reason << LL_ENDL; - if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) + const S32 MAX_RETRIES = 5; + + if (mRetry < MAX_RETRIES) { - LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED ); + std::string url = mRegion->getCapability("Seed"); + + mRetry++; + + llinfos << "retry " << mRetry << " posting to seed " << url << llendl; + + mRegion->setSeedCapability(url, mRetry); + } + else + { + if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) + { + LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED ); + } } } @@ -242,14 +257,15 @@ public: } static boost::intrusive_ptr<BaseCapabilitiesComplete> build( - LLViewerRegion* region) + LLViewerRegion* region, S32 retry) { return boost::intrusive_ptr<BaseCapabilitiesComplete>( - new BaseCapabilitiesComplete(region)); + new BaseCapabilitiesComplete(region, retry)); } private: LLViewerRegion* mRegion; + S32 mRetry; }; @@ -1477,9 +1493,9 @@ void LLViewerRegion::unpackRegionHandshake() msg->sendReliable(host); } -void LLViewerRegion::setSeedCapability(const std::string& url) +void LLViewerRegion::setSeedCapability(const std::string& url, S32 retry) { - if (getCapability("Seed") == url) + if (retry == 0 && getCapability("Seed") == url) { // llwarns << "Ignoring duplicate seed capability" << llendl; return; @@ -1569,7 +1585,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) llinfos << "posting to seed " << url << llendl; - mImpl->mHttpResponderPtr = BaseCapabilitiesComplete::build(this) ; + mImpl->mHttpResponderPtr = BaseCapabilitiesComplete::build(this, retry) ; LLHTTPClient::post(url, capabilityNames, mImpl->mHttpResponderPtr); } |