From 52fab641041ed1ba409a03fee77a0cdaec86dea2 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 20 Dec 2011 16:16:49 -0800 Subject: * Added "InventoryOutboxLogging" debug setting to log merchant outbox related web API calls. Each message begins with the tag "SLM". --- indra/newview/app_settings/settings.xml | 11 ++++++ indra/newview/llmarketplacefunctions.cpp | 39 ++++++++++++++++++++-- .../default/xui/en/floater_merchant_outbox.xml | 2 +- 3 files changed, 49 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c51197bbf1..e5bb686123 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4271,6 +4271,17 @@ Value 0 + InventoryOutboxLogging + + Comment + Enable debug output associated with the Merchant Outbox. + Persist + 1 + Type + Boolean + Value + 0 + InventoryOutboxMaxFolderCount Comment diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 225bb059c9..9a83c5fcb7 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -31,6 +31,7 @@ #include "llagent.h" #include "llhttpclient.h" #include "lltrans.h" +#include "llviewercontrol.h" #include "llviewermedia.h" #include "llviewernetwork.h" @@ -108,12 +109,13 @@ namespace LLMarketplaceImport // Internal state variables static std::string sMarketplaceCookie = ""; + static LLSD sImportId = LLSD::emptyMap(); static bool sImportInProgress = false; static bool sImportPostPending = false; static bool sImportGetPending = false; static U32 sImportResultStatus = 0; static LLSD sImportResults = LLSD::emptyMap(); - + // Responders @@ -124,9 +126,17 @@ namespace LLMarketplaceImport void completed(U32 status, const std::string& reason, const LLSD& content) { + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) + { + llinfos << " SLM POST status: " << status << llendl; + llinfos << " SLM POST reason: " << reason << llendl; + llinfos << " SLM POST content: " << content.asString() << llendl; + } + sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE); sImportPostPending = false; sImportResultStatus = status; + sImportId = content; } }; @@ -142,6 +152,13 @@ namespace LLMarketplaceImport void completed(U32 status, const std::string& reason, const LLSD& content) { + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) + { + llinfos << " SLM GET status: " << status << llendl; + llinfos << " SLM GET reason: " << reason << llendl; + llinfos << " SLM GET content: " << content.asString() << llendl; + } + sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING); sImportGetPending = false; sImportResultStatus = status; @@ -236,6 +253,11 @@ namespace LLMarketplaceImport std::string url = getInventoryImportURL(); + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) + { + llinfos << " SLM GET: " << url << llendl; + } + LLHTTPClient::get(url, new LLImportGetResponder(), LLViewerMedia::getHeaders()); } @@ -245,18 +267,26 @@ namespace LLMarketplaceImport std::string url = getInventoryImportURL(); + url += sImportId.asString(); + // Make the headers for the post LLSD headers = LLSD::emptyMap(); headers["Accept"] = "*/*"; headers["Cookie"] = sMarketplaceCookie; - headers["Content-Type"] = "application/xml"; + headers["Content-Type"] = "application/llsd+xml"; headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) + { + llinfos << " SLM GET: " << url << llendl; + } + LLHTTPClient::get(url, new LLImportGetResponder(), headers); } void triggerImport() { + sImportId = LLSD::emptyMap(); sImportInProgress = true; sImportPostPending = true; sImportResultStatus = MarketplaceErrorCodes::IMPORT_PROCESSING; @@ -272,6 +302,11 @@ namespace LLMarketplaceImport headers["Content-Type"] = "application/xml"; headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) + { + llinfos << " SLM POST: " << url << llendl; + } + LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers); // Set a timer (for testing only) diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml index eb68339022..02394e8ac3 100644 --- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml +++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml @@ -16,7 +16,7 @@ 0 folders 1 folder [NUM] folders - Sending items... + Sending folders... Initializing...