From 40f9de414fbd5755b7c040f786030157cf083771 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 6 Dec 2011 11:45:21 -0800 Subject: Added code to set up the marketplace session cookie and use it for subsequent posts and gets to the inventory import API --- indra/newview/llpanelmarketplaceoutbox.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra') 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 t_panel_marketplace_outbox("panel_marketplace_outbox"); +static std::string sMarketplaceCookie; + const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() { return LLUICtrlFactory::getDefaultParams(); @@ -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; -- cgit v1.2.3