summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-xindra/llmessage/llavatarnamecache.cpp9
-rwxr-xr-xindra/llmessage/llavatarnamecache.h2
-rwxr-xr-xindra/llmessage/llbuffer.cpp2
-rwxr-xr-xindra/llmessage/llcachename.cpp2
-rwxr-xr-xindra/llmessage/llcurl.cpp1
-rwxr-xr-xindra/llmessage/llhttpnode.cpp4
-rwxr-xr-xindra/llmessage/llhttpsender.cpp3
-rwxr-xr-xindra/llmessage/llhttpsender.h2
-rwxr-xr-xindra/llmessage/llmessagetemplate.h1
-rwxr-xr-xindra/llmessage/lltemplatemessagereader.cpp6
-rwxr-xr-xindra/llmessage/message.cpp19
11 files changed, 39 insertions, 12 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 9a68093427..31dd264021 100755
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -680,6 +680,15 @@ void LLAvatarNameCache::setUseDisplayNames(bool use)
}
}
+void LLAvatarNameCache::setUseUsernames(bool use)
+{
+ if (use != LLAvatarName::useUsernames())
+ {
+ LLAvatarName::setUseUsernames(use);
+ mUseDisplayNamesSignal();
+ }
+}
+
void LLAvatarNameCache::erase(const LLUUID& agent_id)
{
sCache.erase(agent_id);
diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h
index 2a8eb46187..3a19cee3ed 100755
--- a/indra/llmessage/llavatarnamecache.h
+++ b/indra/llmessage/llavatarnamecache.h
@@ -80,6 +80,8 @@ namespace LLAvatarNameCache
// Set display name: flips the switch and triggers the callbacks.
void setUseDisplayNames(bool use);
+ void setUseUsernames(bool use);
+
void insert(const LLUUID& agent_id, const LLAvatarName& av_name);
void erase(const LLUUID& agent_id);
diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp
index 01da20f060..aaa49d2ed6 100755
--- a/indra/llmessage/llbuffer.cpp
+++ b/indra/llmessage/llbuffer.cpp
@@ -225,7 +225,7 @@ LLBufferArray::LLBufferArray() :
LLBufferArray::~LLBufferArray()
{
std::for_each(mBuffers.begin(), mBuffers.end(), DeletePointer());
-
+ mBuffers.clear();
delete mMutexp;
}
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 267c48e1d2..13d779ff83 100755
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -278,7 +278,9 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg)
LLCacheName::Impl::~Impl()
{
for_each(mCache.begin(), mCache.end(), DeletePairedPointer());
+ mCache.clear();
for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer());
+ mReplyQueue.clear();
}
boost::signals2::connection LLCacheName::Impl::addPending(const LLUUID& id, const LLCacheNameCallback& callback)
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 25e175f2cc..9e68c68858 100755
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -1741,6 +1741,7 @@ void LLCurl::cleanupClass()
#if SAFE_SSL
CRYPTO_set_locking_callback(NULL);
for_each(sSSLMutex.begin(), sSSLMutex.end(), DeletePointer());
+ sSSLMutex.clear();
#endif
LL_CHECK_MEMORY
diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp
index 5c2f73eccb..f6ccb5bdda 100755
--- a/indra/llmessage/llhttpnode.cpp
+++ b/indra/llmessage/llhttpnode.cpp
@@ -76,8 +76,8 @@ LLHTTPNode::LLHTTPNode()
// virtual
LLHTTPNode::~LLHTTPNode()
{
- std::for_each(impl.mNamedChildren.begin(), impl.mNamedChildren.end(),
- DeletePairedPointer());
+ std::for_each(impl.mNamedChildren.begin(), impl.mNamedChildren.end(), DeletePairedPointer());
+ impl.mNamedChildren.clear();
delete impl.mWildcardChild;
diff --git a/indra/llmessage/llhttpsender.cpp b/indra/llmessage/llhttpsender.cpp
index c48cbc42a6..d0bd343db6 100755
--- a/indra/llmessage/llhttpsender.cpp
+++ b/indra/llmessage/llhttpsender.cpp
@@ -38,7 +38,7 @@ namespace
{
typedef std::map<LLHost, LLHTTPSender*> SenderMap;
static SenderMap senderMap;
- static LLHTTPSender* defaultSender = new LLHTTPSender();
+ static LLPointer<LLHTTPSender> defaultSender(new LLHTTPSender());
}
//virtual
@@ -90,6 +90,5 @@ void LLHTTPSender::clearSender(const LLHost& host)
//static
void LLHTTPSender::setDefaultSender(LLHTTPSender* sender)
{
- delete defaultSender;
defaultSender = sender;
}
diff --git a/indra/llmessage/llhttpsender.h b/indra/llmessage/llhttpsender.h
index 88920db24d..ff8fa2f95b 100755
--- a/indra/llmessage/llhttpsender.h
+++ b/indra/llmessage/llhttpsender.h
@@ -32,7 +32,7 @@
class LLHost;
class LLSD;
-class LLHTTPSender
+class LLHTTPSender : public LLThreadSafeRefCount
{
public:
diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h
index ae8e0087c1..005a49cedf 100755
--- a/indra/llmessage/llmessagetemplate.h
+++ b/indra/llmessage/llmessagetemplate.h
@@ -118,6 +118,7 @@ public:
~LLMsgData()
{
for_each(mMemberBlocks.begin(), mMemberBlocks.end(), DeletePairedPointer());
+ mMemberBlocks.clear();
}
void addBlock(LLMsgBlkData *blockp)
diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp
index ab91f74abe..94bc7cb045 100755
--- a/indra/llmessage/lltemplatemessagereader.cpp
+++ b/indra/llmessage/lltemplatemessagereader.cpp
@@ -91,15 +91,17 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
}
LLMsgBlkData *msg_block_data = iter->second;
- LLMsgVarData& vardata = msg_block_data->mMemberVarData[vnamep];
+ LLMsgBlkData::msg_var_data_map_t &var_data_map = msg_block_data->mMemberVarData;
- if (!vardata.getName())
+ if (var_data_map.find(vnamep) == var_data_map.end())
{
llerrs << "Variable "<< vnamep << " not in message "
<< mCurrentRMessageData->mName<< " block " << bnamep << llendl;
return;
}
+ LLMsgVarData& vardata = msg_block_data->mMemberVarData[vnamep];
+
if (size && size != vardata.getSize())
{
llerrs << "Msg " << mCurrentRMessageData->mName
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index ae95087377..c3642ccbe8 100755
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -3032,12 +3032,23 @@ void LLMessageSystem::setExceptionFunc(EMessageException e,
BOOL LLMessageSystem::callExceptionFunc(EMessageException exception)
{
callbacks_t::iterator it = mExceptionCallbacks.find(exception);
- if(it != mExceptionCallbacks.end())
+ if(it == mExceptionCallbacks.end())
{
- ((*it).second.first)(this, (*it).second.second,exception);
- return TRUE;
+ return FALSE;
}
- return FALSE;
+
+ exception_t& ex = it->second;
+ msg_exception_callback ex_cb = ex.first;
+
+ if (!ex_cb)
+ {
+ LL_WARNS("Messaging") << "LLMessageSystem::callExceptionFunc: bad message exception callback." << llendl;
+ return FALSE;
+ }
+
+ (ex_cb)(this, ex.second, exception);
+
+ return TRUE;
}
void LLMessageSystem::setTimingFunc(msg_timing_callback func, void* data)