diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-12-20 16:16:49 -0800 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-12-20 16:16:49 -0800 |
commit | 52fab641041ed1ba409a03fee77a0cdaec86dea2 (patch) | |
tree | 7f1d012d8d50fe2ab6aa6af14df88af3684b6d03 | |
parent | 2a3b7f295fa82d5d4826cfd912fd07ebbe5f9c21 (diff) |
* Added "InventoryOutboxLogging" debug setting to log merchant outbox related web API calls. Each message begins with the tag "SLM".
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llmarketplacefunctions.cpp | 39 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_merchant_outbox.xml | 2 |
3 files changed, 49 insertions, 3 deletions
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 @@ <key>Value</key> <integer>0</integer> </map> + <key>InventoryOutboxLogging</key> + <map> + <key>Comment</key> + <string>Enable debug output associated with the Merchant Outbox.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>InventoryOutboxMaxFolderCount</key> <map> <key>Comment</key> 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 @@ <string name="OutboxFolderCount0">0 folders</string> <string name="OutboxFolderCount1">1 folder</string> <string name="OutboxFolderCountN">[NUM] folders</string> - <string name="OutboxImporting">Sending items...</string> + <string name="OutboxImporting">Sending folders...</string> <string name="OutboxInitializing">Initializing...</string> <panel follows="all" |