diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index dedec3bd7..8784a84c4 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -352,8 +352,13 @@ void AIEngine::mainloop(void) void AIEngine::flush(void) { - DoutEntering(dc::statemachine, "AIEngine::flush [" << mName << "]"); engine_state_type_wat engine_state_w(mEngineState); + DoutEntering(dc::statemachine, "AIEngine::flush [" << mName << "]: calling force_killed() on " << engine_state_w->list.size() << " state machines."); + for (queued_type::iterator iter = engine_state_w->list.begin(); iter != engine_state_w->list.end(); ++iter) + { + // To avoid an assertion in ~AIStateMachine. + iter->statemachine().force_killed(); + } engine_state_w->list.clear(); } @@ -906,6 +911,12 @@ void AIStateMachine::callback(void) } } +void AIStateMachine::force_killed(void) +{ + multiplex_state_type_wat state_w(mState); + state_w->base_state = bs_killed; +} + void AIStateMachine::kill(void) { DoutEntering(dc::statemachine, "AIStateMachine::kill() [" << (void*)this << "]"); diff --git a/indra/aistatemachine/aistatemachine.h b/indra/aistatemachine/aistatemachine.h index 10031a834..979205e02 100644 --- a/indra/aistatemachine/aistatemachine.h +++ b/indra/aistatemachine/aistatemachine.h @@ -300,8 +300,9 @@ class AIStateMachine : public LLThreadSafeRefCount mSleep = 0; return mSleep != 0; } + void force_killed(void); // Called from AIEngine::flush(). - friend class AIEngine; // Calls multiplex(). + friend class AIEngine; // Calls multiplex() and force_killed(). }; bool AIEngine::QueueElementComp::operator()(QueueElement const& e1, QueueElement const& e2) const diff --git a/indra/llmessage/aihttptimeoutpolicy.cpp b/indra/llmessage/aihttptimeoutpolicy.cpp index d5e0dd3b6..840532e43 100644 --- a/indra/llmessage/aihttptimeoutpolicy.cpp +++ b/indra/llmessage/aihttptimeoutpolicy.cpp @@ -707,6 +707,13 @@ AIHTTPTimeoutPolicyBase connect_40s(AIHTTPTimeoutPolicyBase::getDebugSettingsCur connectOp40s ); +// This used to be FETCHING_TIMEOUT (for HTTP textures), being a 15 second timeout from start of request till finishing receiving all data. +// That seems way to demanding however; lets use a 15 second reply delay demand instead. +Reply replyOp15s(15); +AIHTTPTimeoutPolicyBase reply_15s(AIHTTPTimeoutPolicyBase::getDebugSettingsCurlTimeout(), + replyOp15s + ); + // End of policy definitions. //======================================================================================================= @@ -899,7 +906,7 @@ P2(gamingDataReceived, transfer_18s); P2(groupMemberDataResponder, transfer_300s); P2(groupProposalBallotResponder, transfer_300s); P(homeLocationResponder); -P(HTTPGetResponder); +P2(HTTPGetResponder, reply_15s); P(iamHereLogin); P(iamHere); P(iamHereVoice); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 1d3634573..5efd486e0 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -972,8 +972,6 @@ void LLTextureFetchWorker::startWork(S32 param) // Called from LLWorkerThread::processRequest() bool LLTextureFetchWorker::doWork(S32 param) { - static const F32 FETCHING_TIMEOUT = 15.f;//seconds - LLMutexLock lock(&mWorkMutex); if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) @@ -1304,8 +1302,6 @@ bool LLTextureFetchWorker::doWork(S32 param) bool res = false; if (!mUrl.empty()) { - mRequestedTimer.reset(); - mLoaded = FALSE; mGetStatus = 0; mGetReason.clear(); @@ -1334,17 +1330,17 @@ bool LLTextureFetchWorker::doWork(S32 param) mRequestedOffset--; } - // Will call callbackHttpGet when curl request completes - AIHTTPHeaders headers("Accept", "image/x-j2c"); - // Call LLHTTPClient::request directly instead of LLHTTPClient::getByteRange, because we want to pass a NULL AIEngine. - if (mRequestedOffset > 0 || mRequestedSize > 0) - { - headers.addHeader("Range", llformat("bytes=%d-%d", mRequestedOffset, mRequestedOffset + mRequestedSize - 1)); - } - LLHTTPClient::request(mUrl, LLHTTPClient::HTTP_GET, NULL, - new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset, true), - headers/*,*/ DEBUG_CURLIO_PARAM(false), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL); - res = true; + // Will call callbackHttpGet when curl request completes + AIHTTPHeaders headers("Accept", "image/x-j2c"); + // Call LLHTTPClient::request directly instead of LLHTTPClient::getByteRange, because we want to pass a NULL AIEngine. + if (mRequestedOffset > 0 || mRequestedSize > 0) + { + headers.addHeader("Range", llformat("bytes=%d-%d", mRequestedOffset, mRequestedOffset + mRequestedSize - 1)); + } + LLHTTPClient::request(mUrl, LLHTTPClient::HTTP_GET, NULL, + new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset, true), + headers/*,*/ DEBUG_CURLIO_PARAM(false), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL); + res = true; } if (!res) { @@ -1533,13 +1529,6 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { - if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32()) - { - //timeout, abort. - mState = DONE; - return true; - } - setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); return false; }