summaryrefslogtreecommitdiff
path: root/indra/newview/llmarketplacefunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmarketplacefunctions.cpp')
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp81
1 files changed, 61 insertions, 20 deletions
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 0b009b68f7..835615723a 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -30,6 +30,7 @@
#include "llagent.h"
#include "llhttpclient.h"
+#include "llsdserialize.h"
#include "lltimer.h"
#include "lltrans.h"
#include "llviewercontrol.h"
@@ -135,19 +136,25 @@ namespace LLMarketplaceImport
llinfos << " SLM POST status: " << status << llendl;
llinfos << " SLM POST reason: " << reason << llendl;
llinfos << " SLM POST content: " << content.asString() << llendl;
-
llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl;
}
- if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) ||
- (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
- (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
+ // MAINT-2301 : we determined we can safely ignore that error in that context
+ if (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM POST clearing marketplace cookie due to authentication failure or timeout" << llendl;
+ llinfos << " SLM POST : Ignoring time out status and treating it as success" << llendl;
+ }
+ status = MarketplaceErrorCodes::IMPORT_DONE;
+ }
+
+ if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST)
+ {
+ if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+ {
+ llinfos << " SLM POST clearing marketplace cookie due to client or server error" << llendl;
}
-
sMarketplaceCookie.clear();
}
@@ -182,20 +189,23 @@ namespace LLMarketplaceImport
llinfos << " SLM GET status: " << status << llendl;
llinfos << " SLM GET reason: " << reason << llendl;
llinfos << " SLM GET content: " << content.asString() << llendl;
-
llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
}
- if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
- (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
+ // MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS
+ if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) &&
+ (status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS))
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM GET clearing marketplace cookie due to authentication failure or timeout" << llendl;
+ llinfos << " SLM GET clearing marketplace cookie due to client or server error" << llendl;
}
-
sMarketplaceCookie.clear();
}
+ else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS))
+ {
+ llinfos << " SLM GET : Got IMPORT_DONE_WITH_ERRORS, marketplace cookie not cleared." << llendl;
+ }
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
sImportGetPending = false;
@@ -256,7 +266,12 @@ namespace LLMarketplaceImport
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM GET: " << url << llendl;
+ llinfos << " SLM GET: establishMarketplaceSessionCookie, LLHTTPClient::get, url = " << url << llendl;
+ LLSD headers = LLViewerMedia::getHeaders();
+ std::stringstream str;
+ LLSDSerialize::toPrettyXML(headers, str);
+ llinfos << " SLM GET: headers " << llendl;
+ llinfos << str.str() << llendl;
}
slmGetTimer.start();
@@ -287,7 +302,11 @@ namespace LLMarketplaceImport
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM GET: " << url << llendl;
+ llinfos << " SLM GET: pollStatus, LLHTTPClient::get, url = " << url << llendl;
+ std::stringstream str;
+ LLSDSerialize::toPrettyXML(headers, str);
+ llinfos << " SLM GET: headers " << llendl;
+ llinfos << str.str() << llendl;
}
slmGetTimer.start();
@@ -321,11 +340,15 @@ namespace LLMarketplaceImport
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM POST: " << url << llendl;
+ llinfos << " SLM POST: triggerImport, LLHTTPClient::post, url = " << url << llendl;
+ std::stringstream str;
+ LLSDSerialize::toPrettyXML(headers, str);
+ llinfos << " SLM POST: headers " << llendl;
+ llinfos << str.str() << llendl;
}
slmPostTimer.start();
- LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers);
+ LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers);
return true;
}
@@ -356,6 +379,7 @@ LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter()
: mAutoTriggerImport(false)
, mImportInProgress(false)
, mInitialized(false)
+ , mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED)
, mErrorInitSignal(NULL)
, mStatusChangedSignal(NULL)
, mStatusReportSignal(NULL)
@@ -398,16 +422,20 @@ void LLMarketplaceInventoryImporter::initialize()
if (!LLMarketplaceImport::hasSessionCookie())
{
+ mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING;
LLMarketplaceImport::establishMarketplaceSessionCookie();
}
+ else
+ {
+ mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT;
+ }
}
void LLMarketplaceInventoryImporter::reinitializeAndTriggerImport()
{
mInitialized = false;
-
+ mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED;
initialize();
-
mAutoTriggerImport = true;
}
@@ -459,17 +487,30 @@ void LLMarketplaceInventoryImporter::updateImport()
if (mInitialized)
{
+ mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT;
// Follow up with auto trigger of import
if (mAutoTriggerImport)
{
mAutoTriggerImport = false;
-
mImportInProgress = triggerImport();
}
}
- else if (mErrorInitSignal)
+ else
{
- (*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
+ U32 status = LLMarketplaceImport::getResultStatus();
+ if ((status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) ||
+ (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR))
+ {
+ mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT;
+ }
+ else
+ {
+ mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE;
+ }
+ if (mErrorInitSignal && (mMarketPlaceStatus == MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE))
+ {
+ (*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
+ }
}
}
}