Permalink
Browse files

llmessage merge and further LLUnit usage.

  • Loading branch information...
Shyotl committed Apr 8, 2016
1 parent 8c946dc commit 691a5395ca876219a212e03236a2a6792a97d529
Showing with 519 additions and 470 deletions.
  1. +1 −1 indra/llcommon/llframetimer.h
  2. +1 −1 indra/llinventory/llparcel.cpp
  3. +19 −5 indra/llmessage/llares.cpp
  4. +8 −1 indra/llmessage/llareslistener.cpp
  5. +12 −8 indra/llmessage/llassetstorage.cpp
  6. +11 −10 indra/llmessage/llassetstorage.h
  7. +19 −18 indra/llmessage/llavatarnamecache.cpp
  8. +1 −1 indra/llmessage/llavatarnamecache.h
  9. +1 −1 indra/llmessage/llbuffer.h
  10. +106 −95 indra/llmessage/llcircuit.cpp
  11. +42 −41 indra/llmessage/llcircuit.h
  12. +1 −2 indra/llmessage/llhttpsender.cpp
  13. +1 −1 indra/llmessage/llhttpsender.h
  14. +3 −3 indra/llmessage/llpacketack.cpp
  15. +6 −5 indra/llmessage/llpacketack.h
  16. +1 −1 indra/llmessage/llpacketbuffer.cpp
  17. +0 −1 indra/llmessage/llpacketring.cpp
  18. +2 −2 indra/llmessage/llproxy.cpp
  19. +22 −22 indra/llmessage/llthrottle.cpp
  20. +3 −3 indra/llmessage/llthrottle.h
  21. +44 −26 indra/llmessage/lltransfermanager.cpp
  22. +2 −2 indra/llmessage/lltransfermanager.h
  23. +6 −6 indra/llmessage/llxfermanager.cpp
  24. +2 −2 indra/llmessage/llxfermanager.h
  25. +34 −34 indra/llmessage/message.cpp
  26. +21 −24 indra/llmessage/message.h
  27. +1 −3 indra/llmessage/net.cpp
  28. +1 −1 indra/newview/llstartup.cpp
  29. +24 −21 indra/newview/lltexturefetch.cpp
  30. +36 −44 indra/newview/lltextureinfo.cpp
  31. +11 −11 indra/newview/lltextureinfo.h
  32. +3 −1 indra/newview/lltextureinfodetails.cpp
  33. +7 −7 indra/newview/lltextureinfodetails.h
  34. +6 −6 indra/newview/llviewerassetstats.cpp
  35. +1 −1 indra/newview/llviewerassetstats.h
  36. +5 −4 indra/newview/llviewerassetstorage.cpp
  37. +2 −2 indra/newview/llviewerassetstorage.h
  38. +35 −33 indra/newview/llviewerobject.cpp
  39. +8 −10 indra/newview/llviewerobject.h
  40. +4 −4 indra/newview/llviewerregion.cpp
  41. +3 −3 indra/newview/llviewerregion.h
  42. +2 −2 indra/newview/llviewerstats.cpp
  43. +1 −1 indra/newview/llvoavatar.cpp
@@ -51,7 +51,7 @@ class LL_COMMON_API LLFrameTimer
// Atomic reads of static variables.
// Return the number of seconds since the start of the application.
static F64 getElapsedSeconds(void)
static F64SecondsImplicit getElapsedSeconds(void)
{
// Loses msec precision after ~4.5 hours...
sGlobalMutex.lock();
@@ -1083,7 +1083,7 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group)
mGroupID.setNull();
}
mSaleTimerExpires.start();
mSaleTimerExpires.setTimerExpirySec(DEFAULT_USEC_SALE_TIMEOUT / SEC_TO_MICROSEC);
mSaleTimerExpires.setTimerExpirySec(U64Microseconds(DEFAULT_USEC_SALE_TIMEOUT));
mStatus = OS_LEASE_PENDING;
mClaimDate = time(NULL);
setAuctionID(0);
View
@@ -162,12 +162,26 @@ void LLAres::getSrvRecords(const std::string &name, SrvResponder *resp)
}
void LLAres::rewriteURI(const std::string &uri, UriRewriteResponder *resp)
{
LL_INFOS() << "Rewriting " << uri << LL_ENDL;
{
if (resp && uri.size())
{
LLURI* pURI = new LLURI(uri);
resp->mUri = *pURI;
resp->mUri = LLURI(uri);
search("_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName(),
RES_SRV, resp);
delete pURI;
if (!resp->mUri.scheme().size() || !resp->mUri.hostName().size())
{
return;
}
//LL_INFOS() << "LLAres::rewriteURI (" << uri << ") search: '" << "_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName() << "'" << LL_ENDL;
search("_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName(), RES_SRV, resp);
}
}
LLQueryResponder::LLQueryResponder()
@@ -93,5 +93,12 @@ class UriRewriteResponder: public LLAres::UriRewriteResponder
void LLAresListener::rewriteURI(const LLSD& data)
{
mAres->rewriteURI(data["uri"], new UriRewriteResponder(data));
if (mAres)
{
mAres->rewriteURI(data["uri"], new UriRewriteResponder(data));
}
else
{
LL_INFOS() << "LLAresListener::rewriteURI requested without Ares present. Ignoring: " << data << LL_ENDL;
}
}
@@ -190,8 +190,8 @@ LLSD LLAssetRequest::getTerseDetails() const
sd["asset_id"] = getUUID();
sd["type_long"] = LLAssetType::lookupHumanReadable(getType());
sd["type"] = LLAssetType::lookup(getType());
sd["time"] = mTime;
time_t timestamp = (time_t) mTime;
sd["time"] = mTime.value();
time_t timestamp = (time_t) mTime.value();
std::ostringstream time_string;
time_string << ctime(&timestamp);
sd["time_string"] = time_string.str();
@@ -337,7 +337,7 @@ void LLAssetStorage::checkForTimeouts()
void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)
{
F64 mt_secs = LLMessageSystem::getMessageTimeSeconds();
F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds();
request_list_t timed_out;
S32 rt;
@@ -638,6 +638,10 @@ void LLAssetStorage::downloadCompleteCallback(
vfile.remove();
}
}
// we will be deleting elements of mPendingDownloads which req might be part of, save id and type for reference
LLUUID callback_id = req->getUUID();
LLAssetType::EType callback_type = req->getType();
// find and callback ALL pending requests for this UUID
// SJB: We process the callbacks in reverse order, I do not know if this is important,
@@ -661,7 +665,7 @@ void LLAssetStorage::downloadCompleteCallback(
LLAssetRequest* tmp = *curiter;
if (tmp->mDownCallback)
{
tmp->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), tmp->mUserData, result, ext_status);
tmp->mDownCallback(gAssetStorage->mVFS, callback_id, callback_type, tmp->mUserData, result, ext_status);
}
delete tmp;
}
@@ -1390,7 +1394,7 @@ void LLAssetStorage::storeAssetData(
bool is_priority,
bool store_local,
bool user_waiting,
F64 timeout)
F64Seconds timeout)
{
LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
@@ -1409,7 +1413,7 @@ void LLAssetStorage::storeAssetData(
bool store_local,
const LLUUID& requesting_agent_id,
bool user_waiting,
F64 timeout)
F64Seconds timeout)
{
LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
@@ -1427,7 +1431,7 @@ void LLAssetStorage::storeAssetData(
bool temp_file,
bool is_priority,
bool user_waiting,
F64 timeout)
F64Seconds timeout)
{
LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
@@ -1445,7 +1449,7 @@ void LLAssetStorage::storeAssetData(
bool temp_file,
bool is_priority,
bool user_waiting,
F64 timeout)
F64Seconds timeout)
{
LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
@@ -49,7 +49,8 @@ class LLSD;
// anything that takes longer than this to download will abort.
// HTTP Uploads also timeout if they take longer than this.
const F32 LL_ASSET_STORAGE_TIMEOUT = 5 * 60.0f;
const F32Minutes LL_ASSET_STORAGE_TIMEOUT(5);
// Specific error codes
const int LL_ERR_ASSET_REQUEST_FAILED = -1;
@@ -102,7 +103,7 @@ class LLAssetRequest
void setUUID(const LLUUID& id) { mUUID = id; }
void setType(LLAssetType::EType type) { mType = type; }
void setTimeout (F64 timeout) { mTimeout = timeout; }
void setTimeout (F64Seconds timeout) { mTimeout = timeout; }
protected:
LLUUID mUUID;
@@ -118,8 +119,8 @@ class LLAssetRequest
BOOL mIsTemp;
BOOL mIsLocal;
BOOL mIsUserWaiting; // We don't want to try forever if a user is waiting for a result.
F64 mTime; // Message system time
F64 mTimeout; // Amount of time before timing out.
F64Seconds mTime; // Message system time
F64Seconds mTimeout; // Amount of time before timing out.
BOOL mIsPriority;
BOOL mDataSentInFirstPacket;
BOOL mDataIsInVFS;
@@ -162,7 +163,7 @@ class LLInvItemRequest
void *mUserData;
LLHost mHost;
BOOL mIsTemp;
F64 mTime; // Message system time
F64Seconds mTime; // Message system time
BOOL mIsPriority;
BOOL mDataSentInFirstPacket;
BOOL mDataIsInVFS;
@@ -192,7 +193,7 @@ class LLEstateAssetRequest
void *mUserData;
LLHost mHost;
BOOL mIsTemp;
F64 mTime; // Message system time
F64Seconds mTime; // Message system time
BOOL mIsPriority;
BOOL mDataSentInFirstPacket;
BOOL mDataIsInVFS;
@@ -284,7 +285,7 @@ class LLAssetStorage : public LLTempAssetStorage
bool is_priority = false,
bool store_local = false,
bool user_waiting= false,
F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
/*
* AssetID version
@@ -300,7 +301,7 @@ class LLAssetStorage : public LLTempAssetStorage
bool store_local = false,
const LLUUID& requesting_agent_id = LLUUID::null,
bool user_waiting= false,
F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
virtual void checkForTimeouts();
@@ -408,7 +409,7 @@ class LLAssetStorage : public LLTempAssetStorage
bool temp_file = false,
bool is_priority = false,
bool user_waiting = false,
F64 timeout = LL_ASSET_STORAGE_TIMEOUT);
F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT);
/*
* TransactionID version
@@ -422,7 +423,7 @@ class LLAssetStorage : public LLTempAssetStorage
bool temp_file = false,
bool is_priority = false,
bool user_waiting = false,
F64 timeout = LL_ASSET_STORAGE_TIMEOUT);
F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT);
static void legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType, void *user_data, S32 status, LLExtStat ext_status);
static void legacyStoreDataCallback(const LLUUID &uuid, void *user_data, S32 status, LLExtStat ext_status);
@@ -365,9 +365,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
if (!url.empty())
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability requested "
<< ids << " ids"
<< LL_ENDL;
LL_INFOS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability getting " << ids << " ids" << LL_ENDL;
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
}
}
@@ -391,8 +389,7 @@ void LLAvatarNameCache::legacyNameFetch(const LLUUID& agent_id,
const std::string& full_name,
bool is_group)
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameFetch "
<< "agent " << agent_id << " "
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache agent " << agent_id << " "
<< "full name '" << full_name << "'"
<< ( is_group ? " [group]" : "" )
<< LL_ENDL;
@@ -439,12 +436,13 @@ void LLAvatarNameCache::cleanupClass()
sCache.clear();
}
void LLAvatarNameCache::importFile(std::istream& istr)
bool LLAvatarNameCache::importFile(std::istream& istr)
{
LLSD data;
if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
{
return;
LL_WARNS("AvNameCache") << "avatar name cache data xml parse failed" << LL_ENDL;
return false;
}
// by convention LLSD storage is a map
@@ -460,17 +458,19 @@ void LLAvatarNameCache::importFile(std::istream& istr)
av_name.fromLLSD( it->second );
sCache[agent_id] = av_name;
}
LL_INFOS("AvNameCache") << "loaded " << sCache.size() << LL_ENDL;
LL_INFOS("AvNameCache") << "LLAvatarNameCache loaded " << sCache.size() << LL_ENDL;
// Some entries may have expired since the cache was stored,
// but they will be flushed in the first call to eraseUnrefreshed
// from LLAvatarNameResponder::idle
return true;
}
void LLAvatarNameCache::exportFile(std::ostream& ostr)
{
LLSD agents;
F64 max_unrefreshed = LLFrameTimer::getTotalSeconds() - MAX_UNREFRESHED_TIME;
LL_INFOS("AvNameCache") << "LLAvatarNameCache at exit cache has " << sCache.size() << LL_ENDL;
cache_t::const_iterator it = sCache.begin();
for ( ; it != sCache.end(); ++it)
{
@@ -483,6 +483,7 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr)
agents[agent_id.asString()] = av_name.asLLSD();
}
}
LL_INFOS("AvNameCache") << "LLAvatarNameCache returning " << agents.size() << LL_ENDL;
LLSD data;
data["agents"] = agents;
LLSDSerialize::toPrettyXML(data, ostr);
@@ -525,6 +526,7 @@ void LLAvatarNameCache::idle()
}
else
{
LL_WARNS_ONCE("AvNameCache") << "LLAvatarNameCache still using legacy api" << LL_ENDL;
requestNamesViaLegacy();
}
}
@@ -562,24 +564,26 @@ void LLAvatarNameCache::eraseUnrefreshed()
if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed)
{
sLastExpireCheck = now;
S32 expired = 0;
for (cache_t::iterator it = sCache.begin(); it != sCache.end();)
{
const LLAvatarName& av_name = it->second;
if (av_name.mExpires < max_unrefreshed)
{
LL_DEBUGS("AvNameCache") << it->first
LL_DEBUGS("AvNameCacheExpired") << "LLAvatarNameCache " << it->first
<< " user '" << av_name.getAccountName() << "' "
<< "expired " << now - av_name.mExpires << " secs ago"
<< LL_ENDL;
sCache.erase(it++);
expired++;
}
else
{
++it;
}
}
LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL;
LL_INFOS("AvNameCache") << "LLAvatarNameCache expired " << expired << " cached avatar names, "
<< sCache.size() << " remaining" << LL_ENDL;
}
}
@@ -600,8 +604,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
{
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "refresh agent " << agent_id
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache refresh agent " << agent_id
<< LL_ENDL;
sAskQueue.insert(agent_id);
}
@@ -623,9 +626,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "queue request for agent " << agent_id
<< LL_ENDL;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache queue request for agent " << agent_id << LL_ENDL;
sAskQueue.insert(agent_id);
}
@@ -784,7 +785,7 @@ bool LLAvatarNameCache::expirationFromCacheControl(AIHTTPReceivedHeaders const&
fromCacheControl = true;
}
}
LL_DEBUGS("AvNameCache")
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache "
<< ( fromCacheControl ? "expires based on cache control " : "default expiration " )
<< "in " << *expires - now << " seconds"
<< LL_ENDL;
@@ -46,7 +46,7 @@ namespace LLAvatarNameCache
void cleanupClass();
// Import/export the name cache to file.
void importFile(std::istream& istr);
bool importFile(std::istream& istr);
void exportFile(std::ostream& ostr);
// On the viewer, usually a simulator capabilitity.
@@ -306,7 +306,7 @@ class LLBufferArray
typedef std::list<LLSegment> segment_list_t;
typedef segment_list_t::const_iterator const_segment_iterator_t;
typedef segment_list_t::iterator segment_iterator_t;
static size_t const npos = (size_t)-1; // (U8*)npos is used as a magic address.
enum { npos = 0xffffffff };
LLBufferArray();
~LLBufferArray();
Oops, something went wrong.

0 comments on commit 691a539

Please sign in to comment.