diff options
author | Don Kjer <don@lindenlab.com> | 2013-08-09 14:52:54 -0700 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2013-08-09 14:52:54 -0700 |
commit | c1af1a692a6bd0f3cdfb3f49cc2451717481b685 (patch) | |
tree | 14932943b15060b91a8ee6dfdb6e1cc6172e0cb7 /indra/newview/llaisapi.cpp | |
parent | 3ed3b88892adb4234c375d2d6bd5f0d2da5566c7 (diff) |
Routing link creating through AISv3 when available.
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rwxr-xr-x | indra/newview/llaisapi.cpp | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index f8c9447b17..73aaebc050 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -100,20 +100,9 @@ void AISCommand::httpSuccess() /*virtual*/ void AISCommand::httpFailure() { - const LLSD& content = getContent(); + LL_WARNS("Inventory") << dumpResponse() << LL_ENDL; S32 status = getStatus(); - const std::string& reason = getReason(); const LLSD& headers = getResponseHeaders(); - if (!content.isMap()) - { - LL_DEBUGS("Inventory") << "Malformed response contents " << content - << " status " << status << " reason " << reason << LL_ENDL; - } - else - { - LL_DEBUGS("Inventory") << "failed with content: " << ll_pretty_print_sd(content) - << " status " << status << " reason " << reason << LL_ENDL; - } mRetryPolicy->onFailure(status, headers); F32 seconds_to_wait; if (mRetryPolicy->shouldRetry(seconds_to_wait)) @@ -276,6 +265,30 @@ UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& item_id, setCommandFunc(cmd); } +CreateInventoryCommand::CreateInventoryCommand(const LLUUID& parent_id, + const LLSD& new_inventory, + LLPointer<LLInventoryCallback> callback): + mNewInventory(new_inventory), + AISCommand(callback) +{ + std::string cap; + if (!getInvCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + LLUUID tid; + tid.generate(); + std::string url = cap + std::string("/category/") + parent_id.asString() + "?tid=" + tid.asString(); + LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::post, url, mNewInventory, responder, headers, timeout); + setCommandFunc(cmd); +} + SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback): mContents(contents), AISCommand(callback) |