summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-12-06 11:45:21 -0800
committerLeslie Linden <leslie@lindenlab.com>2011-12-06 11:45:21 -0800
commit40f9de414fbd5755b7c040f786030157cf083771 (patch)
treeccc1d1f8958558a4526b14698c4611be63a3121f /indra/newview
parenta255fadfab359931d591c6a874abbea5fcf13526 (diff)
Added code to set up the marketplace session cookie and use it for subsequent posts and gets to the inventory import API
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelmarketplaceoutbox.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index 99d744891a..d4b0bead4c 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -50,6 +50,8 @@
static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox");
+static std::string sMarketplaceCookie;
+
const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams()
{
return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceOutbox>();
@@ -263,6 +265,15 @@ public:
{
}
+ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ {
+ std::string cookie = content["set-cookie"].asString();
+
+ llinfos << "*** Marketplace *** " << "inventory/import headers set-cookie: " << cookie << llendl;
+
+ sMarketplaceCookie = cookie;
+ }
+
void completed(U32 status, const std::string& reason, const LLSD& content)
{
llinfos << "*** Marketplace *** " << "inventory/import get status: " << status << ", reason: " << reason << llendl;
@@ -295,6 +306,7 @@ void LLPanelMarketplaceOutbox::importPostTrigger()
LLSD headers = LLViewerMedia::getHeaders();
headers["Connection"] = "Keep-Alive";
+ headers["Cookie"] = sMarketplaceCookie;
llinfos << "*** Marketplace *** " << "http post: " << url << llendl;
llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
@@ -311,6 +323,7 @@ void LLPanelMarketplaceOutbox::importGetTrigger()
std::string url = getMarketplaceURL_InventoryImport();
LLSD headers = LLViewerMedia::getHeaders();
+ headers["Cookie"] = sMarketplaceCookie;
llinfos << "*** Marketplace *** " << "http get: " << url << llendl;
llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;