summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-xindra/llmessage/llavatarnamecache.cpp39
-rwxr-xr-xindra/llmessage/llavatarnamecache.h2
-rwxr-xr-xindra/llmessage/llcachename.cpp3
-rwxr-xr-xindra/llmessage/llcircuit.cpp2
-rwxr-xr-xindra/llmessage/llhttpassetstorage.cpp3
-rwxr-xr-xindra/llmessage/llhttpclient.cpp2
-rwxr-xr-xindra/llmessage/lliopipe.h72
-rwxr-xr-xindra/llmessage/llmessageconfig.cpp2
-rwxr-xr-xindra/llmessage/llpartdata.cpp5
-rwxr-xr-xindra/llmessage/llregionhandle.h4
-rwxr-xr-xindra/llmessage/llservicebuilder.cpp2
-rwxr-xr-xindra/llmessage/llthrottle.cpp2
-rwxr-xr-xindra/llmessage/llxfermanager.cpp2
-rwxr-xr-xindra/llmessage/message.cpp2
-rwxr-xr-xindra/llmessage/tests/llhost_test.cpp30
15 files changed, 67 insertions, 105 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index d02a60b7b2..549708097a 100755
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -355,9 +355,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));
}
}
@@ -381,8 +379,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;
@@ -411,7 +408,7 @@ void LLAvatarNameCache::requestNamesViaLegacy()
// invoked below. This should never happen in practice.
sPendingQueue[agent_id] = now;
- LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL;
+ LL_DEBUGS("AvNameCache") << "agent " << agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3));
@@ -429,12 +426,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
@@ -450,17 +448,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)
{
@@ -473,6 +473,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);
@@ -515,6 +516,7 @@ void LLAvatarNameCache::idle()
}
else
{
+ LL_WARNS_ONCE("AvNameCache") << "LLAvatarNameCache still using legacy api" << LL_ENDL;
requestNamesViaLegacy();
}
}
@@ -552,24 +554,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;
}
}
@@ -590,8 +594,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);
}
@@ -603,9 +606,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);
}
@@ -734,7 +735,7 @@ bool LLAvatarNameCache::expirationFromCacheControl(const LLSD& headers, F64 *exp
fromCacheControl = true;
}
}
- LL_DEBUGS("AvNameCache")
+ LL_DEBUGS("AvNameCache") << "LLAvatarNameCache "
<< ( fromCacheControl ? "expires based on cache control " : "default expiration " )
<< "in " << *expires - now << " seconds"
<< LL_ENDL;
diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h
index ea016b3125..5a10053a69 100755
--- a/indra/llmessage/llavatarnamecache.h
+++ b/indra/llmessage/llavatarnamecache.h
@@ -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.
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 4dd8d04656..daf3e0b4de 100755
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -51,9 +51,6 @@ static const std::string NAME("name");
// We won't re-request a name during this time
const U32 PENDING_TIMEOUT_SECS = 5 * 60;
-// File version number
-const S32 CN_FILE_VERSION = 2;
-
// Globals
LLCacheName* gCacheName = NULL;
std::map<std::string, std::string> LLCacheName::sCacheName;
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index 955a66f864..8dbe2f8411 100755
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -689,7 +689,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
// now, check to see if we've got a gap
U32 gap = 0;
- if ((mPacketsInID == id))
+ if (mPacketsInID == id)
{
// nope! bump and wrap the counter, then return
mPacketsInID++;
diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp
index a30140e8f3..e202154445 100755
--- a/indra/llmessage/llhttpassetstorage.cpp
+++ b/indra/llmessage/llhttpassetstorage.cpp
@@ -47,8 +47,7 @@
const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset";
const U32 MAX_RUNNING_REQUESTS = 1;
-const F32 MAX_PROCESSING_TIME = 0.005f;
-const S32 CURL_XFER_BUFFER_SIZE = 65536;
+
// Try for 30 minutes for now.
const F32 GET_URL_TO_FILE_TIMEOUT = 1800.0f;
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index 200116337d..f8db3dded2 100755
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -157,7 +157,7 @@ namespace
{
LLBufferStream ostream(channels, buffer.get());
- llifstream fstream(mFilename, std::iostream::binary | std::iostream::out);
+ llifstream fstream(mFilename.c_str(), std::iostream::binary | std::iostream::out);
if(fstream.is_open())
{
fstream.seekg(0, std::ios::end);
diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h
index 9a0a427efd..7fd4cee8ba 100755
--- a/indra/llmessage/lliopipe.h
+++ b/indra/llmessage/lliopipe.h
@@ -56,11 +56,8 @@ void pump_debug(const char *file, S32 line);
/**
* intrusive pointer support
*/
-namespace boost
-{
- void intrusive_ptr_add_ref(LLIOPipe* p);
- void intrusive_ptr_release(LLIOPipe* p);
-};
+void intrusive_ptr_add_ref(LLIOPipe* p);
+void intrusive_ptr_release(LLIOPipe* p);
/**
* @class LLIOPipe
@@ -251,68 +248,21 @@ protected:
LLPumpIO* pump) = 0;
private:
- friend void boost::intrusive_ptr_add_ref(LLIOPipe* p);
- friend void boost::intrusive_ptr_release(LLIOPipe* p);
+ friend void intrusive_ptr_add_ref(LLIOPipe* p);
+ friend void intrusive_ptr_release(LLIOPipe* p);
U32 mReferenceCount;
};
-namespace boost
+inline void intrusive_ptr_add_ref(LLIOPipe* p)
{
- inline void intrusive_ptr_add_ref(LLIOPipe* p)
- {
- ++p->mReferenceCount;
- }
- inline void intrusive_ptr_release(LLIOPipe* p)
+ ++p->mReferenceCount;
+}
+inline void intrusive_ptr_release(LLIOPipe* p)
+{
+ if(p && 0 == --p->mReferenceCount)
{
- if(p && 0 == --p->mReferenceCount)
- {
- delete p;
- }
+ delete p;
}
-};
-
-
-#if 0
-/**
- * @class LLIOBoiler
- * @brief This class helps construct new LLIOPipe specializations
- * @see LLIOPipe
- *
- * THOROUGH_DESCRIPTION
- */
-class LLIOBoiler : public LLIOPipe
-{
-public:
- LLIOBoiler();
- virtual ~LLIOBoiler();
-
-protected:
- /* @name LLIOPipe virtual implementations
- */
- //@{
- /**
- * @brief Process the data in buffer
- */
- virtual EStatus process_impl(
- const LLChannelDescriptors& channels,
- buffer_ptr_t& buffer,
- bool& eos,
- LLSD& context,
- LLPumpIO* pump);
- //@}
-};
-
-// virtual
-LLIOPipe::EStatus process_impl(
- const LLChannelDescriptors& channels,
- buffer_ptr_t& buffer,
- bool& eos,
- LLSD& context,
- LLPumpIO* pump)
-{
- return STATUS_NOT_IMPLEMENTED;
}
-#endif // #if 0 - use this block as a boilerplate
-
#endif // LL_LLIOPIPE_H
diff --git a/indra/llmessage/llmessageconfig.cpp b/indra/llmessage/llmessageconfig.cpp
index f8b2c8f5a6..64e79d6767 100755
--- a/indra/llmessage/llmessageconfig.cpp
+++ b/indra/llmessage/llmessageconfig.cpp
@@ -96,7 +96,7 @@ bool LLMessageConfigFile::loadFile()
{
LLSD data;
{
- llifstream file(filename());
+ llifstream file(filename().c_str());
if (file.is_open())
{
diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp
index 41a0310ce0..53aa35c0f9 100755
--- a/indra/llmessage/llpartdata.cpp
+++ b/indra/llmessage/llpartdata.cpp
@@ -49,11 +49,6 @@ const S32 PS_MAX_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE+
const S32 PS_LEGACY_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE + PS_LEGACY_PART_DATA_BLOCK_SIZE;
-
-const U32 PART_DATA_MASK = LLPartData::LL_PART_DATA_GLOW | LLPartData::LL_PART_DATA_BLEND;
-
-
-
const F32 MAX_PART_SCALE = 4.f;
bool LLPartData::hasGlow() const
diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h
index e3ddd46acd..085757dcbc 100755
--- a/indra/llmessage/llregionhandle.h
+++ b/indra/llmessage/llregionhandle.h
@@ -73,7 +73,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
}
else
{
- x_int = (U32)llround(x_pos);
+ x_int = (U32)ll_round(x_pos);
}
if (y_pos < 0.f)
{
@@ -82,7 +82,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
}
else
{
- y_int = (U32)llround(y_pos);
+ y_int = (U32)ll_round(y_pos);
}
*region_handle = to_region_handle(x_int, y_int);
return TRUE;
diff --git a/indra/llmessage/llservicebuilder.cpp b/indra/llmessage/llservicebuilder.cpp
index 392e7f1091..cf2e42f95c 100755
--- a/indra/llmessage/llservicebuilder.cpp
+++ b/indra/llmessage/llservicebuilder.cpp
@@ -34,7 +34,7 @@
void LLServiceBuilder::loadServiceDefinitionsFromFile(
const std::string& service_filename)
{
- llifstream service_file(service_filename, std::ios::binary);
+ llifstream service_file(service_filename.c_str(), std::ios::binary);
if(service_file.is_open())
{
LLSD service_data;
diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp
index e484bd258d..7605da4d3f 100755
--- a/indra/llmessage/llthrottle.cpp
+++ b/indra/llmessage/llthrottle.cpp
@@ -391,7 +391,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
}
mBitsSentThisPeriod[i] = 0;
- total += llround(mBitsSentHistory[i]);
+ total += ll_round(mBitsSentHistory[i]);
}
// Look for busy channels
diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp
index b518dd1b72..0ab67b8dda 100755
--- a/indra/llmessage/llxfermanager.cpp
+++ b/indra/llmessage/llxfermanager.cpp
@@ -261,7 +261,7 @@ U32 LLXferManager::numActiveListEntries(LLXfer *list_head)
while (list_head)
{
- if ((list_head->mStatus == e_LL_XFER_IN_PROGRESS))
+ if (list_head->mStatus == e_LL_XFER_IN_PROGRESS)
{
num_entries++;
}
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 3d81bf31d5..e9ce94ab3b 100755
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -2752,7 +2752,7 @@ void LLMessageSystem::dumpReceiveCounts()
if (mt->mReceiveCount > 0)
{
LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes
- << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL;
+ << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << ll_round(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL;
}
}
}
diff --git a/indra/llmessage/tests/llhost_test.cpp b/indra/llmessage/tests/llhost_test.cpp
index eadf83c428..efca1bbfca 100755
--- a/indra/llmessage/tests/llhost_test.cpp
+++ b/indra/llmessage/tests/llhost_test.cpp
@@ -151,11 +151,31 @@ namespace tut
template<> template<>
void host_object::test<9>()
{
- skip("this test is flaky, but we should figure out why...");
+ skip("this test is irreparably flaky");
// skip("setHostByName(\"google.com\"); getHostName() -> (e.g.) \"yx-in-f100.1e100.net\"");
- std::string hostStr = "lindenlab.com";
+ // nat: is it reasonable to expect LLHost::getHostName() to echo
+ // back something resembling the string passed to setHostByName()?
+ //
+ // If that's not even reasonable, would a round trip in the /other/
+ // direction make more sense? (Call getHostName() for something with
+ // known IP address; call setHostByName(); verify IP address)
+ //
+ // Failing that... is there a plausible way to test getHostName() and
+ // setHostByName()? Hopefully without putting up a dummy local DNS
+ // server?
+
+ // monty: If you don't control the DNS server or the DNS configuration
+ // for the test point then, no, none of these will necessarily be
+ // reliable and may start to fail at any time. Forward translation
+ // is subject to CNAME records and round-robin address assignment.
+ // Reverse lookup is 1-to-many and is more and more likely to have
+ // nothing to do with the forward translation.
+ //
+ // So the test is increasingly meaningless on a real network.
+
+ std::string hostStr = "lindenlab.com";
LLHost host;
- host.setHostByName(hostStr);
+ host.setHostByName(hostStr);
// reverse DNS will likely result in appending of some
// sub-domain to the main hostname. so look for
@@ -177,9 +197,9 @@ namespace tut
template<> template<>
void host_object::test<10>()
{
- std::string hostStr = "64.233.167.99";
+ std::string hostStr = "64.233.167.99";
LLHost host;
- host.setHostByName(hostStr);
+ host.setHostByName(hostStr);
ensure("SetHostByName for dotted IP Address failed", host.getAddress() == ip_string_to_u32(hostStr.c_str()));
}