diff options
author | Robert Knop <prospero@lindenlab.com> | 2009-01-08 16:56:35 +0000 |
---|---|---|
committer | Robert Knop <prospero@lindenlab.com> | 2009-01-08 16:56:35 +0000 |
commit | cc2f19ebd084c309be77ff1e4c8ed4b001cbdb36 (patch) | |
tree | 7e06494710a706bc8706d604413acca46aa5e758 /indra/llmessage/llcachename.cpp | |
parent | 3a5dd71ad60275d0567ceef5ef5f3405c57ba722 (diff) |
svn merge -r104838:107352 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.25
NOTE : also ran
scripts/update_version_files.py --verbose --server --server_channel="Second Life Server"
to update server version information before doing a compile test.
Committed with the results of this version file update.
Conflicts resolved by prospero:
scripts/maintenance/update-groups.py : kept the trunk version (was
merged from Rad Chillies)
scripts/make_deploy_group.py : merge by hand (I'm the one to do this,
anyway)
indra/llcommon/llversionserver.h : kept trunk version
indra/newsim/llgettaskstats.cpp : kept trunk version. (svn revert)This
was imported late into 1.25, after the
branch merged into trunk, and no
changes were made in the 1.25 branch
after the import.
indra/newsim/llparcelstats.cpp : same as llgettaskstats.cpp
indra/newsim/llscriptcounter.h : same as llgettaskstats.cpp
indra/newsim/llagentinfo.cpp : like llgettaskstats.cpp, but more
complicated as some of soft's God-logging
that came from 1.24->1.25 was in here.
Fortunately, the conflict was trivial
(missing include)
idnra/newsim/simulator.cpp : one small conflict. Kept the 1.25 version
of SKU/product stuff, as it was likely part
of the homestead stuff that was recently
put into 1.25. However, there was some
code after that in the merge conflict that
had been removed from trunk that I also
removed in the resolution. This code is 27
lines starting at the comment "Asset cache
service", as can be found in the
server-1.25 branch.
indra/newsim/tests/fakeobjects.h : kept the trunk version. No changes
to 1.25 after parcel stats merge,
except for a compile error fixed by
andrew about which he warned there
would be merge issues...
indra/newsim/tests/llgettaskstats_test.cpp : same as llgettaskstats.cpp
indra/newsim/tests/lllslmanager_tests.cpp : same as llgettaskstats.cpp
indra/newsim/tests/llparcelstats_test.cpp : same as llgettaskstats.cpp
indra/newsim/llgettaskstats.h : same as llgettaskstats.cpp
indra/newsim/llparcelstats.h : same as llgettaskstats.cpp
indra/newsim/llscriptdata.cpp : same as llgettaskstats.cpp, except for a
fix that josh made both to trunk and
1.25
indra/newsim/llscriptdata.h : same as llscriptdata.cpp
indra/newsim/llscriptcounter.cpp : same as llgettaskstats.cpp
indra/newsim/CMakeLists.txt : similar to llgettaskstats.cpp, except that
there was an additional change to trunk
(so doing "svn revert" to keep trunk is
still the right thing)
indra/backbone/multiagentchat.py : where there were conflicts, kept the
server-1.25 version. Phoenix had put
in some fixes for dealing with
omissions of the accept header in the
1.25 branch.
indra/backbone/group_linden_dollar.py : similar to multiagentchat.py.
All but one or two conflicts
were utterly trivial (missing
blank line)
indra/backbone/agent_linden_dollar.py : all merge conflicts were utterly
trivial (missing blank line);
I'm surprised svn got all fussy
about them.
indra/lib/python : conflict was because the externals had been futzed
with in 1.25 during debugging of backbone memory
bloat. Kept the externals as in trunk.
Diffstat (limited to 'indra/llmessage/llcachename.cpp')
-rw-r--r-- | indra/llmessage/llcachename.cpp | 224 |
1 files changed, 6 insertions, 218 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 3d4f24abc7..21c0e579ac 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -42,8 +42,7 @@ #include "llsdserialize.h" #include "lluuid.h" #include "message.h" -#include "llservicebuilder.h" -#include "llframetimer.h" + // Constants static const std::string CN_WAITING("(Loading...)"); // *TODO: translate static const std::string CN_NOBODY("(nobody)"); // *TODO: translate @@ -198,8 +197,6 @@ class LLCacheName::Impl public: LLMessageSystem* mMsg; LLHost mUpstreamHost; - std::string mGroupNameURL; - std::string mAgentNameURL; Cache mCache; // the map of UUIDs to names @@ -225,8 +222,6 @@ public: void processPendingReplies(); void sendRequest(const char* msg_name, const AskQueue& queue); bool isRequestPending(const LLUUID& id); - void getAgentName(const AskQueue&); - void getGroupName(const AskQueue&); // Message system callbacks. void processUUIDRequest(LLMessageSystem* msg, bool isGroup); @@ -240,35 +235,6 @@ public: void notifyObservers(const LLUUID& id, const std::string& first, const std::string& last, BOOL group); }; -class LLHTTPAgentNamesResponse : public LLHTTPClient::Responder -{ -public: - LLHTTPAgentNamesResponse(const LLSD& agent_ids) - : mAgentIDs(agent_ids) - { } - void result(const LLSD& content); -private: - LLHost mSender; - LLSD mAgentIDs; - -}; - -class LLHTTPGroupNamesResponse : public LLHTTPClient::Responder -{ -public: - LLHTTPGroupNamesResponse(const LLSD& group_ids) - : mGroupIDs(group_ids) - { }; - - void result(const LLSD& content); -private: - LLHost mSender; - LLSD mGroupIDs; - -}; - - - /// -------------------------------------------------------------------------- /// class LLCacheName @@ -354,57 +320,6 @@ void LLCacheName::cancelCallback(const LLUUID& id, LLCacheNameCallback callback, } } -void LLCacheName::sendAgentNames(const LLUUID& id, std::string& first, std::string& last) -{ - - LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id); - if (!entry) - { - entry = new LLCacheNameEntry; - impl.mCache[id] = entry; - - } - entry->mIsGroup = false; - entry->mCreateTime = (U32)LLFrameTimer::getTotalSeconds(); - //entry->mFirstName = first; - //entry->mLastName = last; - //LLStringUtil::truncate(entry->mFirstName, DB_FIRST_NAME_BUF_SIZE); - //LLStringUtil::truncate(entry->mLastName, DB_LAST_NAME_BUF_SIZE); - entry->mFirstName = std::string(first, DB_FIRST_NAME_BUF_SIZE); - entry->mLastName = std::string(last, DB_LAST_NAME_BUF_SIZE); - - impl.mPendingQueue.erase(id); - impl.notifyObservers(id, - entry->mFirstName, entry->mLastName, - FALSE); - -} - -void LLCacheName::sendGroupNames(const LLUUID& id, std::string& name) -{ - - LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id); - if (!entry) - { - entry = new LLCacheNameEntry; - impl.mCache[id] = entry; - - } - - entry->mIsGroup = true; - entry->mCreateTime = (U32)time(NULL); - - entry->mGroupName = std::string(name, DB_GROUP_NAME_BUF_SIZE); - - impl.mPendingQueue.erase(id); - - impl.notifyObservers(id, - entry->mFirstName, entry->mLastName, - FALSE); - - -} - void LLCacheName::importFile(LLFILE* fp) { S32 count = 0; @@ -610,16 +525,6 @@ BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) return res; } -void LLCacheName::setGroupURL(const std::string& group_url) -{ - impl.mGroupNameURL = group_url; -} - -void LLCacheName::setAgentURL(const std::string& agent_url) -{ - impl.mAgentNameURL = agent_url; -} - BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) { if(id.isNull()) @@ -654,111 +559,6 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) } } -void LLCacheName::Impl::getAgentName(const AskQueue &queue) -{ - - // get the names from backbone module - if(queue.empty()) - { - return; - } - - LLSD request; - request["action"] = "GET"; - LLSD id_block = LLSD::emptyArray(); - AskQueue::const_iterator it = queue.begin(); - AskQueue::const_iterator end = queue.end(); - for(;it!=end;++it) - { - id_block.append(*it); - } - lldebugs<<LLSDOStreamer<LLSDNotationFormatter>(id_block) <<llendl; - - request["agents"] = id_block; - - LLHTTPClient::post( - mAgentNameURL, - request, - new LLHTTPAgentNamesResponse(id_block)); - - - lldebugs<<"Service builder call to agent-name "<<mAgentNameURL<<llendl; - -} - -void LLHTTPAgentNamesResponse::result(const LLSD& content) -{ - LLUUID id; - lldebugs<<LLSDOStreamer<LLSDNotationFormatter>(content) <<llendl; - - LLSD::map_const_iterator iter = content.beginMap(); - for ( ; iter != content.endMap(); ++iter) - { - id.set((*iter).first); - LLSD name = (*iter).second; - LLCacheNameEntry* entry = new LLCacheNameEntry; - entry->mIsGroup = FALSE; - entry->mCreateTime = (U32)LLFrameTimer::getTotalSeconds(); - std::string first = name["first"]; - std::string last = name["last"]; - entry->mFirstName = std::string(first, DB_FIRST_NAME_BUF_SIZE); - entry->mLastName = std::string(last, DB_LAST_NAME_BUF_SIZE); - - gCacheName->sendAgentNames(id,first,last); - } -} - - -void LLCacheName::Impl::getGroupName(const AskQueue &queue) -{ - // get the group names from backbone module - if(queue.empty()) - { - return; - } - - LLSD request; - request["action"] = "GET"; - LLSD id_block = LLSD::emptyArray(); - AskQueue::const_iterator it = queue.begin(); - AskQueue::const_iterator end = queue.end(); - for(;it!=end;++it) - { - id_block.append(*it); - } - - request["groups"] = id_block; - - if(!mGroupNameURL.empty()) - { - LLHTTPClient::post( - mGroupNameURL, - request, - new LLHTTPGroupNamesResponse(id_block)); - } - lldebugs<<"Service builder call to group-name "<< mGroupNameURL<<llendl; -} - -void LLHTTPGroupNamesResponse::result(const LLSD& content) -{ - lldebugs<<"Result"<<LLSDOStreamer<LLSDNotationFormatter>(content) << llendl; - LLUUID id; - - LLSD::map_const_iterator iter = content.beginMap(); - for ( ; iter != content.endMap(); ++iter) - { - - id.set((*iter).first); - std::string name = (*iter).second.asString(); - LLCacheNameEntry* entry = new LLCacheNameEntry; - entry->mIsGroup = TRUE; - entry->mCreateTime = (U32)time(NULL); - entry->mGroupName = std::string(name, DB_GROUP_NAME_BUF_SIZE); - lldebugs<<"Group Name"<<name<<llendl; - gCacheName->sendGroupNames(id,name); - } -} - // TODO: Make the cache name callback take a SINGLE std::string, // not a separate first and last name. void LLCacheName::get(const LLUUID& id, BOOL is_group, LLCacheNameCallback callback, void* user_data) @@ -807,14 +607,12 @@ void LLCacheName::processPending() return; } - /* if(!impl.mUpstreamHost.isOk()) { lldebugs << "LLCacheName::processPending() - bad upstream host." << llendl; return; } - */ impl.processPendingAsks(); impl.processPendingReplies(); @@ -896,16 +694,8 @@ std::string LLCacheName::getDefaultName() void LLCacheName::Impl::processPendingAsks() { - if (mUpstreamHost.isOk()) //its the vuewer asking for names send request to simulator - { - sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue); - sendRequest(_PREHASH_UUIDGroupNameRequest, mAskGroupQueue); - } - else //its simulator asking for names ask the backbone - { - getAgentName(mAskNameQueue); - getGroupName(mAskGroupQueue); - } + sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue); + sendRequest(_PREHASH_UUIDGroupNameRequest, mAskGroupQueue); mAskNameQueue.clear(); mAskGroupQueue.clear(); } @@ -1026,15 +816,12 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) { // You should only get this message if the cache is at the simulator // level, hence having an upstream provider. - // 03/31/2008 Simulator is talking to backbone and not dataserver - // This check was for dataserver - /* if (!mUpstreamHost.isOk()) { llwarns << "LLCacheName - got UUID name/group request, but no upstream provider!" << llendl; return; } - */ + LLHost fromHost = msg->getSender(); ReplySender sender(msg); @@ -1105,8 +892,9 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_LastName, entry->mLastName, i); } else - { + { // is group msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_GroupName, entry->mGroupName, i); + LLStringFn::replace_nonprintable(entry->mGroupName, LL_UNKNOWN_CHAR); } if (!isGroup) |