summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-09-28 22:24:12 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-09-28 22:24:12 +0300
commit32cb17e3bb86e1d3e7b945f49aa39df7868059ce (patch)
tree04c2823be5069e50ccb3363a28c4df2e48ec8cea /indra/llmessage
parent7f2388194136fc45d204f09fe63a6bd32d7e99ff (diff)
parentbac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff)
Merge branch 'master' into DRTVWR-513-maint
# Conflicts: # indra/newview/llgroupmgr.cpp
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llcoproceduremanager.cpp28
-rw-r--r--indra/llmessage/llexperiencecache.cpp16
-rw-r--r--indra/llmessage/llexperiencecache.h2
-rw-r--r--indra/llmessage/llteleportflags.h2
4 files changed, 30 insertions, 18 deletions
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp
index 42c19e3b1c..26684a4d9e 100644
--- a/indra/llmessage/llcoproceduremanager.cpp
+++ b/indra/llmessage/llcoproceduremanager.cpp
@@ -77,12 +77,12 @@ public:
///
inline size_t countActive() const
{
- return mActiveCoprocs.size();
+ return mActiveCoprocsCount;
}
/// Returns the total number of coprocedures either queued or in active processing.
///
- inline size_t count() const
+ inline S32 count() const
{
return countPending() + countActive();
}
@@ -113,12 +113,10 @@ private:
// because the consuming coroutine might outlive this LLCoprocedurePool
// instance.
typedef boost::shared_ptr<CoprocQueue_t> CoprocQueuePtr;
- typedef std::map<LLUUID, LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t> ActiveCoproc_t;
std::string mPoolName;
- size_t mPoolSize, mPending{0};
+ size_t mPoolSize, mActiveCoprocsCount, mPending;
CoprocQueuePtr mPendingCoprocs;
- ActiveCoproc_t mActiveCoprocs;
LLTempBoundListener mStatusListener;
typedef std::map<std::string, LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t> CoroAdapterMap_t;
@@ -191,8 +189,13 @@ LLUUID LLCoprocedureManager::enqueueCoprocedure(const std::string &pool, const s
void LLCoprocedureManager::setPropertyMethods(SettingQuery_t queryfn, SettingUpdate_t updatefn)
{
+ // functions to discover and store the pool sizes
mPropertyQueryFn = queryfn;
mPropertyDefineFn = updatefn;
+
+ // workaround until we get mutex into initializePool
+ initializePool("VAssetStorage");
+ initializePool("Upload");
}
//-------------------------------------------------------------------------
@@ -276,6 +279,8 @@ void LLCoprocedureManager::close(const std::string &pool)
LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size):
mPoolName(poolName),
mPoolSize(size),
+ mActiveCoprocsCount(0),
+ mPending(0),
mPendingCoprocs(boost::make_shared<CoprocQueue_t>(DEFAULT_QUEUE_SIZE)),
mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID),
mCoroMapping()
@@ -401,8 +406,7 @@ void LLCoprocedurePool::coprocedureInvokerCoro(
}
// we actually popped an item
--mPending;
-
- ActiveCoproc_t::iterator itActive = mActiveCoprocs.insert(ActiveCoproc_t::value_type(coproc->mId, httpAdapter)).first;
+ mActiveCoprocsCount++;
LL_DEBUGS("CoProcMgr") << "Dequeued and invoking coprocedure(" << coproc->mName << ") with id=" << coproc->mId.asString() << " in pool \"" << mPoolName << "\" (" << mPending << " left)" << LL_ENDL;
@@ -410,19 +414,25 @@ void LLCoprocedurePool::coprocedureInvokerCoro(
{
coproc->mProc(httpAdapter, coproc->mId);
}
+ catch (const LLCoros::Stop &e)
+ {
+ LL_INFOS("LLCoros") << "coprocedureInvokerCoro terminating because "
+ << e.what() << LL_ENDL;
+ throw; // let toplevel handle this as LLContinueError
+ }
catch (...)
{
LOG_UNHANDLED_EXCEPTION(STRINGIZE("Coprocedure('" << coproc->mName
<< "', id=" << coproc->mId.asString()
<< ") in pool '" << mPoolName << "'"));
// must NOT omit this or we deplete the pool
- mActiveCoprocs.erase(itActive);
+ mActiveCoprocsCount--;
continue;
}
LL_DEBUGS("CoProcMgr") << "Finished coprocedure(" << coproc->mName << ")" << " in pool \"" << mPoolName << "\"" << LL_ENDL;
- mActiveCoprocs.erase(itActive);
+ mActiveCoprocsCount--;
}
}
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index 7d96ac4b02..64c01bd9eb 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -85,15 +85,15 @@ const F64 LLExperienceCache::DEFAULT_EXPIRATION = 600.0;
const S32 LLExperienceCache::DEFAULT_QUOTA = 128; // this is megabytes
const int LLExperienceCache::SEARCH_PAGE_SIZE = 30;
+bool LLExperienceCache::sShutdown = false;
+
//=========================================================================
-LLExperienceCache::LLExperienceCache():
- mShutdown(false)
+LLExperienceCache::LLExperienceCache()
{
}
LLExperienceCache::~LLExperienceCache()
{
-
}
void LLExperienceCache::initSingleton()
@@ -122,7 +122,7 @@ void LLExperienceCache::cleanup()
{
cache_stream << (*this);
}
- mShutdown = true;
+ sShutdown = true;
}
//-------------------------------------------------------------------------
@@ -344,7 +344,7 @@ void LLExperienceCache::requestExperiences()
ostr << urlBase << "?page_size=" << PAGE_SIZE1;
RequestQueue_t requests;
- while (!mRequestQueue.empty())
+ while (!mRequestQueue.empty() && !sShutdown)
{
RequestQueue_t::iterator it = mRequestQueue.begin();
LLUUID key = (*it);
@@ -398,8 +398,6 @@ void LLExperienceCache::idleCoro()
LL_INFOS("ExperienceCache") << "Launching Experience cache idle coro." << LL_ENDL;
do
{
- llcoro::suspendUntilTimeout(SECS_BETWEEN_REQUESTS);
-
if (mEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
{
eraseExpired();
@@ -410,7 +408,9 @@ void LLExperienceCache::idleCoro()
requestExperiences();
}
- } while (!mShutdown);
+ llcoro::suspendUntilTimeout(SECS_BETWEEN_REQUESTS);
+
+ } while (!sShutdown);
// The coroutine system will likely be shut down by the time we get to this point
// (or at least no further cycling will occur on it since the user has decided to quit.)
diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h
index f9ff69c2b6..1c97133723 100644
--- a/indra/llmessage/llexperiencecache.h
+++ b/indra/llmessage/llexperiencecache.h
@@ -142,7 +142,7 @@ private:
LLFrameTimer mEraseExpiredTimer; // Periodically clean out expired entries from the cache
CapabilityQuery_t mCapability;
std::string mCacheFileName;
- bool mShutdown;
+ static bool sShutdown; // control for coroutines, they exist out of LLExperienceCache's scope, so they need a static control
void idleCoro();
void eraseExpired();
diff --git a/indra/llmessage/llteleportflags.h b/indra/llmessage/llteleportflags.h
index b3fcad036e..fd1e702832 100644
--- a/indra/llmessage/llteleportflags.h
+++ b/indra/llmessage/llteleportflags.h
@@ -44,6 +44,8 @@ const U32 TELEPORT_FLAGS_VIA_REGION_ID = 1 << 12;
const U32 TELEPORT_FLAGS_IS_FLYING = 1 << 13;
const U32 TELEPORT_FLAGS_SHOW_RESET_HOME = 1 << 14;
const U32 TELEPORT_FLAGS_FORCE_REDIRECT = 1 << 15; // used to force a redirect to some random location - used when kicking someone from land.
+const U32 TELEPORT_FLAGS_VIA_GLOBAL_COORDS = 1 << 16;
+const U32 TELEPORT_FLAGS_WITHIN_REGION = 1 << 17;
const U32 TELEPORT_FLAGS_MASK_VIA = TELEPORT_FLAGS_VIA_LURE
| TELEPORT_FLAGS_VIA_LANDMARK