summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2014-03-10 10:15:19 -0700
committerdolphin <dolphin@lindenlab.com>2014-03-10 10:15:19 -0700
commit7b9817cbcc5acab58d9d4355984b429850bd3ef8 (patch)
treee6e297900643f01962ee9b527532d6207db1acff /indra/llmessage
parent96457e1affe33d75208cabf7529b53eee8e8105b (diff)
Fixed a bug that lost callbacks if > 10 experiences were looked up at a time.
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llexperiencecache.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index 921c1edc2e..5cca918baf 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -415,40 +415,39 @@ namespace LLExperienceCache
F64 now = LLFrameTimer::getTotalSeconds();
const U32 EXP_URL_SEND_THRESHOLD = 3000;
-
+ const U32 PAGE_SIZE = EXP_URL_SEND_THRESHOLD/UUID_STR_LENGTH;
std::ostringstream ostr;
ask_queue_t keys;
- ostr << sLookupURL;
+ ostr << sLookupURL << "?page_size=" << PAGE_SIZE;
- char arg='?';
int request_count = 0;
- for(ask_queue_t::const_iterator it = sAskQueue.begin() ; it != sAskQueue.end() && request_count < sMaximumLookups; ++it)
+ while(!sAskQueue.empty() && request_count < sMaximumLookups)
{
+ ask_queue_t::const_iterator it = sAskQueue.begin();
const LLUUID& key = it->first;
const std::string& key_type = it->second;
- ostr << arg << key_type << '=' << key.asString() ;
+ ostr << '&' << key_type << '=' << key.asString() ;
keys[key]=key_type;
request_count++;
sPendingQueue[key] = now;
-
- arg='&';
-
+
if(ostr.tellp() > EXP_URL_SEND_THRESHOLD)
{
LL_DEBUGS("ExperienceCache") << "requestExperiences() query: " << ostr.str() << LL_ENDL;
LLHTTPClient::get(ostr.str(), new LLExperienceResponder(keys));
ostr.clear();
ostr.str(sLookupURL);
- arg='?';
+ ostr << "?page_size=" << PAGE_SIZE;
keys.clear();
}
+ sAskQueue.erase(it);
}
if(ostr.tellp() > sLookupURL.size())
@@ -456,8 +455,6 @@ namespace LLExperienceCache
LL_DEBUGS("ExperienceCache") << "requestExperiences() query 2: " << ostr.str() << LL_ENDL;
LLHTTPClient::get(ostr.str(), new LLExperienceResponder(keys));
}
-
- sAskQueue.clear();
}
bool isRequestPending(const LLUUID& public_key)