summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodelbackgroundfetch.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2013-04-11 16:23:36 -0700
committersimon <none@none>2013-04-11 16:23:36 -0700
commit066f2acadf6f1624fcdfc22263a890c370473887 (patch)
treea4e52b29d8074cdc8782ff28b9b0500b32dada50 /indra/newview/llinventorymodelbackgroundfetch.cpp
parent98a82c50d539451e1931826ca75fbc01d611806d (diff)
parent460c81070e5fa1c51ce7e186a9ecb8c5f1c995e1 (diff)
Forgot to commit @#! merge
Diffstat (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp')
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index f4d0110b0f..f2b39e7186 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -183,7 +183,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetchCB(void *)
void LLInventoryModelBackgroundFetch::backgroundFetch()
{
- if (mBackgroundFetchActive && gAgent.getRegion())
+ if (mBackgroundFetchActive && gAgent.getRegion() && gAgent.getRegion()->capabilitiesReceived())
{
// If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
if (gSavedSettings.getBOOL("UseHTTPInventory"))
@@ -366,7 +366,7 @@ class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInvento
public:
LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {};
void result(const LLSD& content);
- void error(U32 status, const std::string& reason);
+ void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
};
void LLInventoryModelFetchItemResponder::result( const LLSD& content )
@@ -375,9 +375,9 @@ void LLInventoryModelFetchItemResponder::result( const LLSD& content )
LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
}
-void LLInventoryModelFetchItemResponder::error( U32 status, const std::string& reason )
+void LLInventoryModelFetchItemResponder::errorWithContent( U32 status, const std::string& reason, const LLSD& content )
{
- LLInventoryModel::fetchInventoryResponder::error(status, reason);
+ LLInventoryModel::fetchInventoryResponder::errorWithContent(status, reason, content);
LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
}
@@ -391,7 +391,7 @@ public:
{};
//LLInventoryModelFetchDescendentsResponder() {};
void result(const LLSD& content);
- void error(U32 status, const std::string& reason);
+ void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
protected:
BOOL getIsRecursive(const LLUUID& cat_id) const;
private:
@@ -529,12 +529,12 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
}
// If we get back an error (not found, etc...), handle it here.
-void LLInventoryModelFetchDescendentsResponder::error(U32 status, const std::string& reason)
+void LLInventoryModelFetchDescendentsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
{
LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
- llinfos << "LLInventoryModelFetchDescendentsResponder::error "
- << status << ": " << reason << llendl;
+ llinfos << "LLInventoryModelFetchDescendentsResponder::error [status:"
+ << status << "]: " << content << llendl;
fetcher->incrFetchCount(-1);
@@ -564,7 +564,6 @@ BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat
{
return (std::find(mRecursiveCatUUIDs.begin(),mRecursiveCatUUIDs.end(), cat_id) != mRecursiveCatUUIDs.end());
}
-
// Bundle up a bunch of requests to send all at once.
// static
void LLInventoryModelBackgroundFetch::bulkFetch()
@@ -687,20 +686,23 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
{
if (folder_count)
{
- std::string url = region->getCapability("FetchInventoryDescendents2");
- mFetchCount++;
- if (folder_request_body["folders"].size())
- {
- LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats);
- LLHTTPClient::post(url, folder_request_body, fetcher, 300.0);
- }
- if (folder_request_body_lib["folders"].size())
+ std::string url = region->getCapability("FetchInventoryDescendents2");
+ if ( !url.empty() )
{
- std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
+ mFetchCount++;
+ if (folder_request_body["folders"].size())
+ {
+ LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats);
+ LLHTTPClient::post(url, folder_request_body, fetcher, 300.0);
+ }
+ if (folder_request_body_lib["folders"].size())
+ {
+ std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
- LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats);
- LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0);
- }
+ LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats);
+ LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0);
+ }
+ }
}
if (item_count)
{