Support for new LL Responder API.
This adds mStatus, mReason and mContent to ResponderBase and fills those in instead of passing it to member functions. The added danger here is that now code can accidently try to access these variables while they didn't already get a correct value. Affected members of ResponderBase (that now have less arguments): decode_llsd_body, decode_raw_body, completedHeaders, completed -> httpCompleted, result -> httpSuccess, errorWithContent and error -> httpFailure. New API: ResponderBase::setResult ResponderBase::getStatus() ResponderBase::getReason() ResponderBase::getContent() ResponderBase::getResponseHeaders() (returns AIHTTPReceivedHeaders though, not LLSD) ResponderBase::dumpResponse() ResponderWithCompleted::completeResult ResponderWithResult::failureResult (previously pubErrorWithContent) ResponderWithResult::successResult (previously pubResult) Not implemented: getHTTPMethod() - use getName() instead which returns the class name of the responder. completedHeaders() is still called as usual, although you can ignore it (not implement in a derived responder) and call getResponseHeaders() instead, provided you implement needsHeaders() and have it return true. However, classes derived from ResponderHeadersOnly do not have completedHeaders(), so they still must implement completedHeaders(), and then call getResponseHeaders() or just access mReceivedHeaders directly, as usual.
This commit is contained in:
@@ -84,20 +84,20 @@ class LLIamHereVoice : public LLHTTPClient::ResponderWithResult
|
||||
mParent = parentIn;
|
||||
};
|
||||
|
||||
/*virtual*/ void result( const LLSD& content )
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if ( mParent )
|
||||
mParent->setSiteIsAlive( true );
|
||||
};
|
||||
|
||||
/*virtual*/ void error( U32 status, const std::string& reason )
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
if ( mParent )
|
||||
{
|
||||
// *HACK: For purposes of this alive check, 302 Found
|
||||
// (aka Moved Temporarily) is considered alive. The web site
|
||||
// redirects this link to a "cache busting" temporary URL. JC
|
||||
bool alive = (status == HTTP_FOUND);
|
||||
bool alive = (mStatus == HTTP_FOUND);
|
||||
mParent->setSiteIsAlive( alive );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -58,8 +58,6 @@ public:
|
||||
EmeraldDicDownloader(lggDicDownloadFloater* spanel, std::string sname);
|
||||
~EmeraldDicDownloader() { }
|
||||
/*virtual*/ void completedRaw(
|
||||
U32 status,
|
||||
const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const buffer_ptr_t& buffer);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return emeraldDicDownloader_timeout; }
|
||||
@@ -167,9 +165,9 @@ EmeraldDicDownloader::EmeraldDicDownloader(lggDicDownloadFloater* spanel, std::s
|
||||
}
|
||||
|
||||
|
||||
void EmeraldDicDownloader::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const buffer_ptr_t& buffer)
|
||||
void EmeraldDicDownloader::completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
if (status < 200 || status >= 300)
|
||||
if (!isGoodStatus(mStatus))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,34 +60,34 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void error( U32 statusNum, const std::string& reason )
|
||||
void httpFailure(void)
|
||||
{
|
||||
llwarns << "Transport error [status:" << statusNum << "]: " << reason << llendl;
|
||||
llwarns << "Transport error [status:" << mStatus << "]: " << mReason << llendl;
|
||||
clearPendingRequests();
|
||||
|
||||
LLAccountingCostObserver* observer = mObserverHandle.get();
|
||||
if (observer && observer->getTransactionID() == mTransactionID)
|
||||
{
|
||||
observer->setErrorStatus(statusNum, reason);
|
||||
observer->setErrorStatus(mStatus, mReason);
|
||||
}
|
||||
}
|
||||
|
||||
void result( const LLSD& content )
|
||||
void httpSuccess(void)
|
||||
{
|
||||
//Check for error
|
||||
if ( !content.isMap() || content.has("error") )
|
||||
if ( !mContent.isMap() || mContent.has("error") )
|
||||
{
|
||||
llwarns << "Error on fetched data"<< llendl;
|
||||
}
|
||||
else if (content.has("selected"))
|
||||
else if (mContent.has("selected"))
|
||||
{
|
||||
F32 physicsCost = 0.0f;
|
||||
F32 networkCost = 0.0f;
|
||||
F32 simulationCost = 0.0f;
|
||||
|
||||
physicsCost = content["selected"]["physics"].asReal();
|
||||
networkCost = content["selected"]["streaming"].asReal();
|
||||
simulationCost = content["selected"]["simulation"].asReal();
|
||||
physicsCost = mContent["selected"]["physics"].asReal();
|
||||
networkCost = mContent["selected"]["streaming"].asReal();
|
||||
simulationCost = mContent["selected"]["simulation"].asReal();
|
||||
|
||||
SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
|
||||
|
||||
|
||||
@@ -2587,8 +2587,8 @@ public:
|
||||
LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity);
|
||||
virtual ~LLMaturityPreferencesResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return maturityPreferences_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLMaturityPreferencesResponder"; }
|
||||
@@ -2612,25 +2612,25 @@ LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void LLMaturityPreferencesResponder::result(const LLSD &pContent)
|
||||
void LLMaturityPreferencesResponder::httpSuccess(void)
|
||||
{
|
||||
U8 actualMaturity = parseMaturityFromServerResponse(pContent);
|
||||
U8 actualMaturity = parseMaturityFromServerResponse(mContent);
|
||||
|
||||
if (actualMaturity != mPreferredMaturity)
|
||||
{
|
||||
llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
|
||||
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '"
|
||||
<< LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast<U32>(actualMaturity) << ", llsd:"
|
||||
<< pContent << "]" << llendl;
|
||||
<< mContent << "]" << llendl;
|
||||
}
|
||||
mAgent->handlePreferredMaturityResult(actualMaturity);
|
||||
}
|
||||
|
||||
void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReason)
|
||||
void LLMaturityPreferencesResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
|
||||
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '"
|
||||
<< pReason << "' [status:" << pStatus << "]" << llendl;
|
||||
<< mReason << "' [status:" << mStatus << "]" << llendl;
|
||||
mAgent->handlePreferredMaturityError();
|
||||
}
|
||||
|
||||
@@ -2820,7 +2820,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
|
||||
// If we don't have a region, report it as an error
|
||||
if (getRegion() == NULL)
|
||||
{
|
||||
responderPtr->error(0U, "region is not defined");
|
||||
responderPtr->failureResult(0U, "region is not defined", LLSD());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2830,7 +2830,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
|
||||
// If the capability is not defined, report it as an error
|
||||
if (url.empty())
|
||||
{
|
||||
responderPtr->error(0U, "capability 'UpdateAgentInformation' is not defined for region");
|
||||
responderPtr->failureResult(0U, "capability 'UpdateAgentInformation' is not defined for region", LLSD());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3506,10 +3506,10 @@ public:
|
||||
}
|
||||
|
||||
// Successful completion.
|
||||
/* virtual */ void result(const LLSD& content)
|
||||
/* virtual */ void httpSuccess(void)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL;
|
||||
if (content["success"].asBoolean())
|
||||
LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(mContent) << LL_ENDL;
|
||||
if (mContent["success"].asBoolean())
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
|
||||
}
|
||||
@@ -3520,11 +3520,10 @@ public:
|
||||
}
|
||||
|
||||
// Error
|
||||
/*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl;
|
||||
LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL;
|
||||
onFailure(status);
|
||||
llwarns << "appearance update request failed, " << dumpResponse() << llendl;
|
||||
onFailure(mStatus);
|
||||
}
|
||||
|
||||
void onFailure(U32 status)
|
||||
|
||||
@@ -75,10 +75,10 @@ public:
|
||||
delete mData;
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "Error: " << reason << llendl;
|
||||
LLUpdateTaskInventoryResponder::error(statusNum, reason);
|
||||
llwarns << "Error: " << mReason << llendl;
|
||||
LLUpdateTaskInventoryResponder::httpFailure();
|
||||
LLAssetUploadQueue *queue = mSupplier->get();
|
||||
if (queue)
|
||||
{
|
||||
@@ -86,15 +86,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
LLUpdateTaskInventoryResponder::result(content);
|
||||
LLUpdateTaskInventoryResponder::httpSuccess();
|
||||
LLAssetUploadQueue *queue = mSupplier->get();
|
||||
if (queue)
|
||||
{
|
||||
// Responder is reused across 2 phase upload,
|
||||
// so only start next upload after 2nd phase complete.
|
||||
std::string state = content["state"];
|
||||
std::string state = mContent["state"];
|
||||
if(state == "complete")
|
||||
{
|
||||
queue->request(&mSupplier);
|
||||
|
||||
@@ -223,12 +223,12 @@ LLAssetUploadResponder::~LLAssetUploadResponder()
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
|
||||
void LLAssetUploadResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "LLAssetUploadResponder::error " << statusNum
|
||||
<< " reason: " << reason << llendl;
|
||||
llinfos << "LLAssetUploadResponder::error " << mStatus
|
||||
<< " reason: " << mReason << llendl;
|
||||
LLSD args;
|
||||
switch(statusNum)
|
||||
switch(mStatus)
|
||||
{
|
||||
case 400:
|
||||
args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
|
||||
@@ -248,15 +248,15 @@ void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLAssetUploadResponder::result(const LLSD& content)
|
||||
void LLAssetUploadResponder::httpSuccess(void)
|
||||
{
|
||||
lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl;
|
||||
|
||||
std::string state = content["state"];
|
||||
std::string state = mContent["state"];
|
||||
|
||||
if (state == "upload")
|
||||
{
|
||||
uploadUpload(content);
|
||||
uploadUpload(mContent);
|
||||
}
|
||||
else if (state == "complete")
|
||||
{
|
||||
@@ -264,14 +264,14 @@ void LLAssetUploadResponder::result(const LLSD& content)
|
||||
if (mFileName.empty())
|
||||
{
|
||||
// rename the file in the VFS to the actual asset id
|
||||
// llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl;
|
||||
gVFS->renameFile(mVFileID, mAssetType, content["new_asset"].asUUID(), mAssetType);
|
||||
// llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl;
|
||||
gVFS->renameFile(mVFileID, mAssetType, mContent["new_asset"].asUUID(), mAssetType);
|
||||
}
|
||||
uploadComplete(content);
|
||||
uploadComplete(mContent);
|
||||
}
|
||||
else
|
||||
{
|
||||
uploadFailure(content);
|
||||
uploadFailure(mContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,13 +332,13 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reason)
|
||||
void LLNewAgentInventoryResponder::httpFailure(void)
|
||||
{
|
||||
if (mCallBack)
|
||||
{
|
||||
(*mCallBack)(false, mUserData);
|
||||
}
|
||||
LLAssetUploadResponder::error(statusNum, reason);
|
||||
LLAssetUploadResponder::httpFailure();
|
||||
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE);
|
||||
}
|
||||
|
||||
@@ -498,9 +498,9 @@ void LLSendTexLayerResponder::uploadComplete(const LLSD& content)
|
||||
}
|
||||
}
|
||||
|
||||
void LLSendTexLayerResponder::error(U32 statusNum, const std::string& reason)
|
||||
void LLSendTexLayerResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "status: " << statusNum << " reason: " << reason << llendl;
|
||||
llinfos << "status: " << mStatus << " reason: " << mReason << llendl;
|
||||
|
||||
// Invoke the original callback with an error result
|
||||
LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID(), (void*) mBakedUploadData, -1, LL_EXSTAT_NONE);
|
||||
@@ -1020,20 +1020,17 @@ LLNewAgentInventoryVariablePriceResponder::~LLNewAgentInventoryVariablePriceResp
|
||||
delete mImpl;
|
||||
}
|
||||
|
||||
void LLNewAgentInventoryVariablePriceResponder::errorWithContent(
|
||||
U32 statusNum,
|
||||
const std::string& reason,
|
||||
const LLSD& content)
|
||||
void LLNewAgentInventoryVariablePriceResponder::httpFailure(void)
|
||||
{
|
||||
lldebugs
|
||||
<< "LLNewAgentInventoryVariablePrice::error " << statusNum
|
||||
<< " reason: " << reason << llendl;
|
||||
<< "LLNewAgentInventoryVariablePrice::error " << mStatus
|
||||
<< " reason: " << mReason << llendl;
|
||||
|
||||
if ( content.has("error") )
|
||||
if ( mContent.has("error") )
|
||||
{
|
||||
static const std::string _ERROR = "error";
|
||||
|
||||
mImpl->onTransportError(content[_ERROR]);
|
||||
mImpl->onTransportError(mContent[_ERROR]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1041,7 +1038,7 @@ void LLNewAgentInventoryVariablePriceResponder::errorWithContent(
|
||||
}
|
||||
}
|
||||
|
||||
void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void)
|
||||
{
|
||||
// Parse out application level errors and the appropriate
|
||||
// responses for them
|
||||
@@ -1056,13 +1053,13 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
static const std::string _RSVP = "rsvp";
|
||||
|
||||
// Check for application level errors
|
||||
if (content.has(_ERROR))
|
||||
if (mContent.has(_ERROR))
|
||||
{
|
||||
onApplicationLevelError(content[_ERROR]);
|
||||
onApplicationLevelError(mContent[_ERROR]);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string state = content[_STATE];
|
||||
std::string state = mContent[_STATE];
|
||||
LLAssetType::EType asset_type = mImpl->getAssetType();
|
||||
|
||||
if (_COMPLETE == state)
|
||||
@@ -1071,11 +1068,11 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
if (mImpl->getFilename().empty())
|
||||
{
|
||||
// rename the file in the VFS to the actual asset id
|
||||
// llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl;
|
||||
// llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl;
|
||||
gVFS->renameFile(
|
||||
mImpl->getVFileID(),
|
||||
asset_type,
|
||||
content["new_asset"].asUUID(),
|
||||
mContent["new_asset"].asUUID(),
|
||||
asset_type);
|
||||
}
|
||||
|
||||
@@ -1086,8 +1083,8 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
mImpl->getFolderID(),
|
||||
mImpl->getItemName(),
|
||||
mImpl->getItemDescription(),
|
||||
content,
|
||||
content[_UPLOAD_PRICE].asInteger());
|
||||
mContent,
|
||||
mContent[_UPLOAD_PRICE].asInteger());
|
||||
|
||||
// TODO* Add bulk (serial) uploading or add
|
||||
// a super class of this that does so
|
||||
@@ -1095,9 +1092,9 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
else if ( _CONFIRM_UPLOAD == state )
|
||||
{
|
||||
showConfirmationDialog(
|
||||
content[_UPLOAD_PRICE].asInteger(),
|
||||
content[_RESOURCE_COST].asInteger(),
|
||||
content[_RSVP].asString());
|
||||
mContent[_UPLOAD_PRICE].asInteger(),
|
||||
mContent[_RESOURCE_COST].asInteger(),
|
||||
mContent[_RSVP].asString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -61,8 +61,8 @@ public:
|
||||
const std::string& file_name,
|
||||
LLAssetType::EType asset_type);
|
||||
~LLAssetUploadResponder();
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason);
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return assetUploadResponder_timeout; }
|
||||
|
||||
virtual void uploadUpload(const LLSD& content);
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
const LLSD& post_data,
|
||||
const std::string& file_name,
|
||||
LLAssetType::EType asset_type);
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
virtual void uploadComplete(const LLSD& content);
|
||||
virtual void uploadFailure(const LLSD& content);
|
||||
/*virtual*/ char const* getName(void) const { return "LLNewAgentInventoryResponder"; }
|
||||
@@ -116,11 +116,8 @@ public:
|
||||
const LLSD& inventory_info);
|
||||
virtual ~LLNewAgentInventoryVariablePriceResponder();
|
||||
|
||||
/*virtual*/ void errorWithContent(
|
||||
U32 statusNum,
|
||||
const std::string& reason,
|
||||
const LLSD& content);
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return newAgentInventoryVariablePriceResponder_timeout; }
|
||||
|
||||
virtual void onApplicationLevelError(
|
||||
@@ -148,7 +145,7 @@ public:
|
||||
~LLSendTexLayerResponder();
|
||||
|
||||
/*virtual*/ void uploadComplete(const LLSD& content);
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ char const* getName(void) const { return "LLSendTexLayerResponder"; }
|
||||
|
||||
LLBakedUploadData * mBakedUploadData;
|
||||
|
||||
@@ -50,14 +50,14 @@ mClassifiedID(classified_id)
|
||||
{
|
||||
}
|
||||
/*virtual*/
|
||||
void LLClassifiedStatsResponder::result(const LLSD& content)
|
||||
void LLClassifiedStatsResponder::httpSuccess(void)
|
||||
{
|
||||
S32 teleport = content["teleport_clicks"].asInteger();
|
||||
S32 map = content["map_clicks"].asInteger();
|
||||
S32 profile = content["profile_clicks"].asInteger();
|
||||
S32 search_teleport = content["search_teleport_clicks"].asInteger();
|
||||
S32 search_map = content["search_map_clicks"].asInteger();
|
||||
S32 search_profile = content["search_profile_clicks"].asInteger();
|
||||
S32 teleport = mContent["teleport_clicks"].asInteger();
|
||||
S32 map = mContent["map_clicks"].asInteger();
|
||||
S32 profile = mContent["profile_clicks"].asInteger();
|
||||
S32 search_teleport = mContent["search_teleport_clicks"].asInteger();
|
||||
S32 search_map = mContent["search_map_clicks"].asInteger();
|
||||
S32 search_profile = mContent["search_profile_clicks"].asInteger();
|
||||
|
||||
LLPanelClassified* classified_panelp = (LLPanelClassified*)mClassifiedPanelHandle.get();
|
||||
|
||||
@@ -73,10 +73,9 @@ void LLClassifiedStatsResponder::result(const LLSD& content)
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLClassifiedStatsResponder::error(U32 status, const std::string& reason)
|
||||
void LLClassifiedStatsResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "LLClassifiedStatsResponder::error("
|
||||
<< status << ": " << reason << ")" << llendl;
|
||||
llinfos << "httpFailure: " << dumpResponse() << llendl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@ class LLClassifiedStatsResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
LLClassifiedStatsResponder(LLHandle<LLView> classified_panel_handle, LLUUID classified_id);
|
||||
//If we get back a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return classifiedStatsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLClassifiedStatsResponder"; }
|
||||
|
||||
|
||||
@@ -56,23 +56,23 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void error(U32 status, const std::string& reason)
|
||||
virtual void httpFailure(void)
|
||||
{
|
||||
llwarns << "Crash report sending failed: " << reason << llendl;
|
||||
llwarns << "Crash report sending failed: " << mReason << llendl;
|
||||
}
|
||||
|
||||
virtual void result(const LLSD& content)
|
||||
virtual void httpSuccess(void)
|
||||
{
|
||||
std::string msg = "Crash report successfully sent";
|
||||
if (content.has("message"))
|
||||
if (mContent.has("message"))
|
||||
{
|
||||
msg += ": " + content["message"].asString();
|
||||
msg += ": " + mContent["message"].asString();
|
||||
}
|
||||
llinfos << msg << llendl;
|
||||
|
||||
if (content.has("report_id"))
|
||||
if (mContent.has("report_id"))
|
||||
{
|
||||
gSavedSettings.setS32("CrashReportID", content["report_id"].asInteger());
|
||||
gSavedSettings.setS32("CrashReportID", mContent["report_id"].asInteger());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -265,9 +265,9 @@ bool LLCurrencyUIManager::Impl::checkTransaction()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->http_status() < 200 || mResponder->http_status() >= 400)
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->getStatus() < 200 || mResponder->getStatus() >= 400)
|
||||
{
|
||||
setError(mResponder->reason(), mResponder->getURL());
|
||||
setError(mResponder->getReason(), mResponder->getURL());
|
||||
}
|
||||
else {
|
||||
switch (mTransactionType)
|
||||
|
||||
@@ -118,16 +118,16 @@ class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
|
||||
// if we get a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
llinfos << "Committed estate info" << llendl;
|
||||
LLEstateInfoModel::instance().notifyCommit();
|
||||
}
|
||||
|
||||
// if we get an error response
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "Failed to commit estate info (" << status << "): " << reason << llendl;
|
||||
llwarns << "Failed to commit estate info (" << mStatus << "): " << mReason << llendl;
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; }
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace
|
||||
|
||||
|
||||
void handleMessage(const LLSD& content);
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ bool is_event_poll(void) const { return true; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return eventPollResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLEventPollResponder"; }
|
||||
@@ -179,13 +179,13 @@ namespace
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLEventPollResponder::error(U32 status, const std::string& reason)
|
||||
void LLEventPollResponder::httpFailure(void)
|
||||
{
|
||||
if (mDone) return;
|
||||
|
||||
// A HTTP_BAD_GATEWAY (502) error is our standard timeout response
|
||||
// we get this when there are no events.
|
||||
if ( status == HTTP_BAD_GATEWAY )
|
||||
if ( mStatus == HTTP_BAD_GATEWAY )
|
||||
{
|
||||
mErrorCount = 0;
|
||||
makeRequest();
|
||||
@@ -199,12 +199,12 @@ namespace
|
||||
+ mErrorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC
|
||||
, this);
|
||||
|
||||
llwarns << "Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl;
|
||||
llwarns << "Unexpected HTTP error. status: " << mStatus << ", reason: " << mReason << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "LLEventPollResponder::error: <" << mCount << "> got "
|
||||
<< status << ": " << reason
|
||||
<< mStatus << ": " << mReason
|
||||
<< (mDone ? " -- done" : "") << llendl;
|
||||
stop();
|
||||
|
||||
@@ -226,25 +226,25 @@ namespace
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLEventPollResponder::result(const LLSD& content)
|
||||
void LLEventPollResponder::httpSuccess(void)
|
||||
{
|
||||
lldebugs << "LLEventPollResponder::result <" << mCount << ">"
|
||||
<< (mDone ? " -- done" : "") << ll_pretty_print_sd(content) << llendl;
|
||||
<< (mDone ? " -- done" : "") << ll_pretty_print_sd(mContent) << llendl;
|
||||
|
||||
if (mDone) return;
|
||||
|
||||
mErrorCount = 0;
|
||||
|
||||
if (!content.get("events") ||
|
||||
!content.get("id"))
|
||||
if (!mContent.get("events") ||
|
||||
!mContent.get("id"))
|
||||
{
|
||||
//llwarns << "received event poll with no events or id key" << llendl;
|
||||
makeRequest();
|
||||
return;
|
||||
}
|
||||
|
||||
mAcknowledge = content["id"];
|
||||
LLSD events = content["events"];
|
||||
mAcknowledge = mContent["id"];
|
||||
LLSD events = mContent["events"];
|
||||
|
||||
if(mAcknowledge.isUndefined())
|
||||
{
|
||||
|
||||
@@ -419,24 +419,24 @@ public:
|
||||
|
||||
LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { }
|
||||
|
||||
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
|
||||
/*virtual*/ void httpCompleted(void)
|
||||
{
|
||||
//std::ostringstream ss;
|
||||
//LLSDSerialize::toPrettyXML(content, ss);
|
||||
//LLSDSerialize::toPrettyXML(mContent, ss);
|
||||
//llinfos << ss.str() << llendl;
|
||||
|
||||
// in case of invalid characters, the avatar picker returns a 400
|
||||
// just set it to process so it displays 'not found'
|
||||
if (isGoodStatus(status) || status == 400)
|
||||
if (isGoodStatus(mStatus) || mStatus == 400)
|
||||
{
|
||||
if (LLFloaterAvatarPicker::instanceExists())
|
||||
{
|
||||
LLFloaterAvatarPicker::getInstance()->processResponse(mQueryID, content);
|
||||
LLFloaterAvatarPicker::getInstance()->processResponse(mQueryID, mContent);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "avatar picker failed " << status << " reason " << reason << llendl;
|
||||
llwarns << "avatar picker failed " << mStatus << " reason " << mReason << llendl;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,9 +863,9 @@ bool LLFloaterBuyLandUI::checkTransaction()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->http_status() < 200 || mResponder->http_status() >= 400)
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->getStatus() < 200 || mResponder->getStatus() >= 400)
|
||||
{
|
||||
tellUserError(mResponder->reason(), mResponder->getURL());
|
||||
tellUserError(mResponder->getReason(), mResponder->getURL());
|
||||
}
|
||||
else {
|
||||
switch (mTransactionType)
|
||||
|
||||
@@ -231,18 +231,18 @@ public:
|
||||
private:
|
||||
static std::string sPreviousReason;
|
||||
|
||||
void error(U32 status, const std::string& reason)
|
||||
void httpFailure(void)
|
||||
{
|
||||
// Do not display the same error more than once in a row
|
||||
if (reason != sPreviousReason)
|
||||
if (mReason != sPreviousReason)
|
||||
{
|
||||
sPreviousReason = reason;
|
||||
sPreviousReason = mReason;
|
||||
LLSD args;
|
||||
args["REASON"] = reason;
|
||||
args["REASON"] = mReason;
|
||||
LLNotificationsUtil::add("DefaultObjectPermissions", args);
|
||||
}
|
||||
}
|
||||
void result(const LLSD& content)
|
||||
void httpSuccess(void)
|
||||
{
|
||||
// Since we have had a successful POST call be sure to display the next error message
|
||||
// even if it is the same as a previous one.
|
||||
|
||||
@@ -258,9 +258,9 @@ public:
|
||||
LLAssetUploadResponder::uploadFailure(content);
|
||||
LLFloaterSnapshot::savePostcardDone(false, mSnapshotIndex);
|
||||
}
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
LLAssetUploadResponder::error(statusNum, reason);
|
||||
LLAssetUploadResponder::httpFailure();
|
||||
LLFloaterSnapshot::savePostcardDone(false, mSnapshotIndex);
|
||||
}
|
||||
/*virtual*/ char const* getName(void) const { return "LLSendPostcardResponder"; }
|
||||
|
||||
@@ -73,14 +73,14 @@ namespace
|
||||
const std::string CONSOLE_NOT_SUPPORTED(
|
||||
"This region does not support the simulator console.");
|
||||
|
||||
// This responder handles the initial response. Unless error() is called
|
||||
// This responder handles the initial response. Unless httpFailure() is called
|
||||
// we assume that the simulator has received our request. Error will be
|
||||
// called if this request times out.
|
||||
//
|
||||
class AsyncConsoleResponder : public LLHTTPClient::ResponderIgnoreBody
|
||||
{
|
||||
public:
|
||||
/*virtual*/ void error(U32 status, const std::string& reason) { sConsoleReplySignal(UNABLE_TO_SEND_COMMAND); }
|
||||
/*virtual*/ void httpFailure(void) { sConsoleReplySignal(UNABLE_TO_SEND_COMMAND); }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return asyncConsoleResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "AsyncConsoleResponder"; }
|
||||
};
|
||||
@@ -92,7 +92,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
if (mOutput)
|
||||
{
|
||||
@@ -102,12 +102,12 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if (mOutput)
|
||||
{
|
||||
mOutput->appendText(
|
||||
content.asString() + PROMPT, false, false);
|
||||
mContent.asString() + PROMPT, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2341,7 +2341,7 @@ public:
|
||||
}
|
||||
|
||||
// if we get a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
LL_INFOS("Windlight") << "Successfully committed estate info" << llendl;
|
||||
|
||||
@@ -2352,10 +2352,10 @@ public:
|
||||
}
|
||||
|
||||
// if we get an error response
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llinfos << "LLEstateChangeInfoResponder::error [status:"
|
||||
<< status << "]: " << reason << llendl;
|
||||
<< mStatus << "]: " << mReason << llendl;
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; }
|
||||
|
||||
@@ -723,12 +723,12 @@ class LLUserReportResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
LLUserReportResponder() { }
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
// *TODO do some user messaging here
|
||||
LLUploadDialog::modalUploadFinished();
|
||||
}
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
// we don't care about what the server returns
|
||||
LLUploadDialog::modalUploadFinished();
|
||||
|
||||
@@ -184,27 +184,27 @@ void LLPanelScriptLimitsInfo::updateChild(LLUICtrl* child_ctr)
|
||||
// Responders
|
||||
///----------------------------------------------------------------------------
|
||||
|
||||
void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
|
||||
void fetchScriptLimitsRegionInfoResponder::httpSuccess(void)
|
||||
{
|
||||
//we don't need to test with a fake response here (shouldn't anyway)
|
||||
|
||||
#ifdef DUMP_REPLIES_TO_LLINFOS
|
||||
|
||||
LLSDNotationStreamer notation_streamer(content);
|
||||
LLSDNotationStreamer notation_streamer(mContent);
|
||||
std::ostringstream nice_llsd;
|
||||
nice_llsd << notation_streamer;
|
||||
|
||||
OSMessageBox(nice_llsd.str(), "main cap response:", 0);
|
||||
|
||||
llinfos << "main cap response:" << content << llendl;
|
||||
llinfos << "main cap response:" << mContent << llendl;
|
||||
|
||||
#endif
|
||||
|
||||
// at this point we have an llsd which should contain ether one or two urls to the services we want.
|
||||
// first we look for the details service:
|
||||
if(content.has("ScriptResourceDetails"))
|
||||
if(mContent.has("ScriptResourceDetails"))
|
||||
{
|
||||
LLHTTPClient::get(content["ScriptResourceDetails"], new fetchScriptLimitsRegionDetailsResponder(mInfo));
|
||||
LLHTTPClient::get(mContent["ScriptResourceDetails"], new fetchScriptLimitsRegionDetailsResponder(mInfo));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -216,18 +216,18 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
|
||||
}
|
||||
|
||||
// then the summary service:
|
||||
if(content.has("ScriptResourceSummary"))
|
||||
if(mContent.has("ScriptResourceSummary"))
|
||||
{
|
||||
LLHTTPClient::get(content["ScriptResourceSummary"], new fetchScriptLimitsRegionSummaryResponder(mInfo));
|
||||
LLHTTPClient::get(mContent["ScriptResourceSummary"], new fetchScriptLimitsRegionSummaryResponder(mInfo));
|
||||
}
|
||||
}
|
||||
|
||||
void fetchScriptLimitsRegionInfoResponder::error(U32 status, const std::string& reason)
|
||||
void fetchScriptLimitsRegionInfoResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "fetchScriptLimitsRegionInfoResponder error [status:" << status << "]: " << reason << llendl;
|
||||
llwarns << "fetchScriptLimitsRegionInfoResponder error [status:" << mStatus << "]: " << mReason << llendl;
|
||||
}
|
||||
|
||||
void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
|
||||
void fetchScriptLimitsRegionSummaryResponder::httpSuccess(void)
|
||||
{
|
||||
#ifdef USE_FAKE_RESPONSES
|
||||
|
||||
@@ -265,7 +265,7 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
|
||||
|
||||
#else
|
||||
|
||||
const LLSD& content = content_ref;
|
||||
const LLSD& content = mContent;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -309,12 +309,12 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
|
||||
}
|
||||
}
|
||||
|
||||
void fetchScriptLimitsRegionSummaryResponder::error(U32 status, const std::string& reason)
|
||||
void fetchScriptLimitsRegionSummaryResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "fetchScriptLimitsRegionSummaryResponder error [status:" << status << "]: " << reason << llendl;
|
||||
llwarns << "fetchScriptLimitsRegionSummaryResponder error [status:" << mStatus << "]: " << mReason << llendl;
|
||||
}
|
||||
|
||||
void fetchScriptLimitsRegionDetailsResponder::result(const LLSD& content_ref)
|
||||
void fetchScriptLimitsRegionDetailsResponder::httpSuccess(void)
|
||||
{
|
||||
#ifdef USE_FAKE_RESPONSES
|
||||
/*
|
||||
@@ -374,7 +374,7 @@ result (map)
|
||||
|
||||
#else
|
||||
|
||||
const LLSD& content = content_ref;
|
||||
const LLSD& content = mContent;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -418,12 +418,12 @@ result (map)
|
||||
}
|
||||
}
|
||||
|
||||
void fetchScriptLimitsRegionDetailsResponder::error(U32 status, const std::string& reason)
|
||||
void fetchScriptLimitsRegionDetailsResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "fetchScriptLimitsRegionDetailsResponder error [status:" << status << "]: " << reason << llendl;
|
||||
llwarns << "fetchScriptLimitsRegionDetailsResponder error [status:" << mStatus << "]: " << mReason << llendl;
|
||||
}
|
||||
|
||||
void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
|
||||
void fetchScriptLimitsAttachmentInfoResponder::httpSuccess(void)
|
||||
{
|
||||
|
||||
#ifdef USE_FAKE_RESPONSES
|
||||
@@ -456,13 +456,13 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
|
||||
summary["used"] = used;
|
||||
|
||||
fake_content["summary"] = summary;
|
||||
fake_content["attachments"] = content_ref["attachments"];
|
||||
fake_content["attachments"] = mContent["attachments"];
|
||||
|
||||
const LLSD& content = fake_content;
|
||||
|
||||
#else
|
||||
|
||||
const LLSD& content = content_ref;
|
||||
const LLSD& content = mContent;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -514,9 +514,9 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
|
||||
}
|
||||
}
|
||||
|
||||
void fetchScriptLimitsAttachmentInfoResponder::error(U32 status, const std::string& reason)
|
||||
void fetchScriptLimitsAttachmentInfoResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "fetchScriptLimitsAttachmentInfoResponder error [status:" << status << "]: " << reason << llendl;
|
||||
llwarns << "fetchScriptLimitsAttachmentInfoResponder error [status:" << mStatus << "]: " << mReason << llendl;
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
|
||||
@@ -90,8 +90,8 @@ class fetchScriptLimitsRegionInfoResponder: public LLHTTPClient::ResponderWithRe
|
||||
public:
|
||||
fetchScriptLimitsRegionInfoResponder(const LLSD& info) : mInfo(info) {};
|
||||
|
||||
void result(const LLSD& content);
|
||||
void error(U32 status, const std::string& reason);
|
||||
void httpSuccess(void);
|
||||
void httpFailure(void);
|
||||
public:
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return fetchScriptLimitsRegionInfoResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "fetchScriptLimitsRegionInfoResponder"; }
|
||||
@@ -105,8 +105,8 @@ class fetchScriptLimitsRegionSummaryResponder: public LLHTTPClient::ResponderWit
|
||||
public:
|
||||
fetchScriptLimitsRegionSummaryResponder(const LLSD& info) : mInfo(info) {};
|
||||
|
||||
void result(const LLSD& content);
|
||||
void error(U32 status, const std::string& reason);
|
||||
void httpSuccess(void);
|
||||
void httpFailure(void);
|
||||
public:
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return fetchScriptLimitsRegionSummaryResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "fetchScriptLimitsRegionSummaryResponder"; }
|
||||
@@ -120,8 +120,8 @@ class fetchScriptLimitsRegionDetailsResponder: public LLHTTPClient::ResponderWit
|
||||
public:
|
||||
fetchScriptLimitsRegionDetailsResponder(const LLSD& info) : mInfo(info) {};
|
||||
|
||||
void result(const LLSD& content);
|
||||
void error(U32 status, const std::string& reason);
|
||||
void httpSuccess(void);
|
||||
void httpFailure(void);
|
||||
public:
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return fetchScriptLimitsRegionDetailsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "fetchScriptLimitsRegionDetailsResponder"; }
|
||||
@@ -135,8 +135,8 @@ class fetchScriptLimitsAttachmentInfoResponder: public LLHTTPClient::ResponderWi
|
||||
public:
|
||||
fetchScriptLimitsAttachmentInfoResponder() {};
|
||||
|
||||
void result(const LLSD& content);
|
||||
void error(U32 status, const std::string& reason);
|
||||
void httpSuccess(void);
|
||||
void httpFailure(void);
|
||||
public:
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return fetchScriptLimitsAttachmentInfoResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "fetchScriptLimitsAttachmentInfoResponder"; }
|
||||
|
||||
@@ -112,20 +112,20 @@ class LLIamHere : public LLHTTPClient::ResponderWithResult
|
||||
mParent = parentIn;
|
||||
};
|
||||
|
||||
/*virtual*/ void result( const LLSD& content )
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if ( mParent )
|
||||
mParent->setSiteIsAlive( true );
|
||||
};
|
||||
|
||||
/*virtual*/ void error( U32 status, const std::string& reason )
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
if ( mParent )
|
||||
{
|
||||
// *HACK: For purposes of this alive check, 302 Found
|
||||
// (aka Moved Temporarily) is considered alive. The web site
|
||||
// redirects this link to a "cache busting" temporary URL. JC
|
||||
bool alive = (status == HTTP_FOUND);
|
||||
bool alive = (mStatus == HTTP_FOUND);
|
||||
mParent->setSiteIsAlive( alive );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -65,21 +65,21 @@ public:
|
||||
|
||||
LLHandle<LLFloater> mParent;
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||
/*virtual*/ void completedHeaders(void)
|
||||
{
|
||||
if (200 <= status && status < 300)
|
||||
if (isGoodStatus(mStatus))
|
||||
{
|
||||
std::string media_type;
|
||||
if (headers.getFirstValue("content-type", media_type))
|
||||
if (mReceivedHeaders.getFirstValue("content-type", media_type))
|
||||
{
|
||||
std::string::size_type idx1 = media_type.find_first_of(";");
|
||||
std::string mime_type = media_type.substr(0, idx1);
|
||||
completeAny(status, mime_type);
|
||||
completeAny(mStatus, mime_type);
|
||||
return;
|
||||
}
|
||||
llwarns << "LLMediaTypeResponder::completedHeaders: OK HTTP status (" << status << ") but no Content-Type! Received headers: " << headers << llendl;
|
||||
llwarns << "LLMediaTypeResponder::completedHeaders: OK HTTP status (" << mStatus << ") but no Content-Type! Received headers: " << mReceivedHeaders << llendl;
|
||||
}
|
||||
completeAny(status, "none/none");
|
||||
completeAny(mStatus, "none/none");
|
||||
}
|
||||
|
||||
void completeAny(U32 status, const std::string& mime_type)
|
||||
|
||||
@@ -1942,22 +1942,22 @@ class GroupMemberDataResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
GroupMemberDataResponder() {}
|
||||
virtual ~GroupMemberDataResponder() {}
|
||||
/*virtual*/ void result(const LLSD& pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return groupMemberDataResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "GroupMemberDataResponder"; }
|
||||
private:
|
||||
LLSD mMemberData;
|
||||
};
|
||||
|
||||
void GroupMemberDataResponder::error(U32 pStatus, const std::string& pReason)
|
||||
void GroupMemberDataResponder::httpFailure(void)
|
||||
{
|
||||
LL_WARNS("GrpMgr") << "Error receiving group member data." << LL_ENDL;
|
||||
}
|
||||
|
||||
void GroupMemberDataResponder::result(const LLSD& content)
|
||||
void GroupMemberDataResponder::httpSuccess(void)
|
||||
{
|
||||
LLGroupMgr::processCapGroupMembersRequest(content);
|
||||
LLGroupMgr::processCapGroupMembersRequest(mContent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "llagent.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
void LLHomeLocationResponder::result( const LLSD& content )
|
||||
void LLHomeLocationResponder::httpSuccess(void)
|
||||
{
|
||||
LLVector3 agent_pos;
|
||||
bool error = true;
|
||||
@@ -48,48 +48,48 @@ void LLHomeLocationResponder::result( const LLSD& content )
|
||||
|
||||
// was the call to /agent/<agent-id>/home-location successful?
|
||||
// If not, we keep error set to true
|
||||
if( ! content.has("success") )
|
||||
if( ! mContent.has("success") )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if( 0 != strncmp("true", content["success"].asString().c_str(), 4 ) )
|
||||
if( 0 != strncmp("true", mContent["success"].asString().c_str(), 4 ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// did the simulator return a "justified" home location?
|
||||
// If no, we keep error set to true
|
||||
if( ! content.has( "HomeLocation" ) )
|
||||
if( ! mContent.has( "HomeLocation" ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if( ! content["HomeLocation"].has("LocationPos") )
|
||||
if( ! mContent["HomeLocation"].has("LocationPos") )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if( ! content["HomeLocation"]["LocationPos"].has("X") )
|
||||
if( ! mContent["HomeLocation"]["LocationPos"].has("X") )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
agent_pos.mV[VX] = content["HomeLocation"]["LocationPos"]["X"].asInteger();
|
||||
agent_pos.mV[VX] = mContent["HomeLocation"]["LocationPos"]["X"].asInteger();
|
||||
|
||||
if( ! content["HomeLocation"]["LocationPos"].has("Y") )
|
||||
if( ! mContent["HomeLocation"]["LocationPos"].has("Y") )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
agent_pos.mV[VY] = content["HomeLocation"]["LocationPos"]["Y"].asInteger();
|
||||
agent_pos.mV[VY] = mContent["HomeLocation"]["LocationPos"]["Y"].asInteger();
|
||||
|
||||
if( ! content["HomeLocation"]["LocationPos"].has("Z") )
|
||||
if( ! mContent["HomeLocation"]["LocationPos"].has("Z") )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
agent_pos.mV[VZ] = content["HomeLocation"]["LocationPos"]["Z"].asInteger();
|
||||
agent_pos.mV[VZ] = mContent["HomeLocation"]["LocationPos"]["Z"].asInteger();
|
||||
|
||||
error = false;
|
||||
} while( 0 );
|
||||
@@ -103,8 +103,8 @@ void LLHomeLocationResponder::result( const LLSD& content )
|
||||
}
|
||||
}
|
||||
|
||||
void LLHomeLocationResponder::error( U32 status, const std::string& reason )
|
||||
void LLHomeLocationResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "received error(" << reason << ")" << llendl;
|
||||
llinfos << "httpFailure: " << dumpResponse() << llendl;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ extern AIHTTPTimeoutPolicy homeLocationResponder_timeout;
|
||||
/* Typedef, Enum, Class, Struct, etc. */
|
||||
class LLHomeLocationResponder : public LLHTTPClient::ResponderWithResult
|
||||
{
|
||||
/*virtual*/ void result( const LLSD& content );
|
||||
/*virtual*/ void error( U32 status, const std::string& reason );
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return homeLocationResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLHomeLocationResponder"; }
|
||||
};
|
||||
|
||||
@@ -172,10 +172,10 @@ public:
|
||||
mAgents = agents_to_invite;
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
//try an "old school" way.
|
||||
if ( statusNum == 400 )
|
||||
if ( mStatus == 400 )
|
||||
{
|
||||
start_deprecated_conference_chat(
|
||||
mTempSessionID,
|
||||
@@ -635,10 +635,10 @@ public:
|
||||
mSessionID = session_id;
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "Error inviting all agents to session [status:"
|
||||
<< statusNum << "]: " << reason << llendl;
|
||||
<< mStatus << "]: " << mReason << llendl;
|
||||
//throw something back to the viewer here?
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
mInvitiationType = invitation_type;
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if ( gIMMgr)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
//but unfortunately, our base that we are receiving here
|
||||
//may not be the most up to date. It was accurate at
|
||||
//some point in time though.
|
||||
speaker_mgr->setSpeakers(content);
|
||||
speaker_mgr->setSpeakers(mContent);
|
||||
|
||||
//we now have our base of users in the session
|
||||
//that was accurate at some point, but maybe not now
|
||||
@@ -167,10 +167,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "LLViewerChatterBoxInvitationAcceptResponder error [status:"
|
||||
<< statusNum << "]: " << reason << llendl;
|
||||
<< mStatus << "]: " << mReason << llendl;
|
||||
//throw something back to the viewer here?
|
||||
if ( gIMMgr )
|
||||
{
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
|
||||
if ( floaterp )
|
||||
{
|
||||
if ( 404 == statusNum )
|
||||
if ( 404 == mStatus )
|
||||
{
|
||||
std::string error_string;
|
||||
error_string = "session_does_not_exist_error";
|
||||
|
||||
@@ -541,24 +541,24 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
LL_WARNS("InvAPI") << "CreateInventoryCategory failed. status = " << status << ", reasion = \"" << reason << "\"" << LL_ENDL;
|
||||
LL_WARNS("InvAPI") << "CreateInventoryCategory failed. status = " << mStatus << ", reason = \"" << mReason << "\"" << LL_ENDL;
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
//Server has created folder.
|
||||
|
||||
LLUUID category_id = content["folder_id"].asUUID();
|
||||
LLUUID category_id = mContent["folder_id"].asUUID();
|
||||
|
||||
|
||||
// Add the category to the internal representation
|
||||
LLPointer<LLViewerInventoryCategory> cat =
|
||||
new LLViewerInventoryCategory( category_id,
|
||||
content["parent_id"].asUUID(),
|
||||
(LLFolderType::EType)content["type"].asInteger(),
|
||||
content["name"].asString(),
|
||||
mContent["parent_id"].asUUID(),
|
||||
(LLFolderType::EType)mContent["type"].asInteger(),
|
||||
mContent["name"].asString(),
|
||||
gAgent.getID() );
|
||||
cat->setVersion(LLViewerInventoryCategory::VERSION_INITIAL);
|
||||
cat->setDescendentCount(0);
|
||||
@@ -568,7 +568,7 @@ public:
|
||||
|
||||
if (mCallback && mData)
|
||||
{
|
||||
mCallback(content, mData);
|
||||
mCallback(mContent, mData);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1469,12 +1469,12 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
|
||||
}
|
||||
|
||||
// If we get back a normal response, handle it here
|
||||
void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
|
||||
void LLInventoryModel::fetchInventoryResponder::httpSuccess(void)
|
||||
{
|
||||
start_new_inventory_observer();
|
||||
|
||||
/*LLUUID agent_id;
|
||||
agent_id = content["agent_id"].asUUID();
|
||||
agent_id = mContent["agent_id"].asUUID();
|
||||
if(agent_id != gAgent.getID())
|
||||
{
|
||||
llwarns << "Got a inventory update for the wrong agent: " << agent_id
|
||||
@@ -1483,13 +1483,13 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
|
||||
}*/
|
||||
item_array_t items;
|
||||
update_map_t update;
|
||||
S32 count = content["items"].size();
|
||||
S32 count = mContent["items"].size();
|
||||
LLUUID folder_id;
|
||||
// Does this loop ever execute more than once?
|
||||
for(S32 i = 0; i < count; ++i)
|
||||
{
|
||||
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
|
||||
titem->unpackMessage(content["items"][i]);
|
||||
titem->unpackMessage(mContent["items"][i]);
|
||||
|
||||
lldebugs << "LLInventoryModel::messageUpdateCore() item id:"
|
||||
<< titem->getUUID() << llendl;
|
||||
@@ -1529,10 +1529,10 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
|
||||
}
|
||||
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
void LLInventoryModel::fetchInventoryResponder::error(U32 status, const std::string& reason)
|
||||
void LLInventoryModel::fetchInventoryResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "fetchInventory::error "
|
||||
<< status << ": " << reason << llendl;
|
||||
<< mStatus << ": " << mReason << llendl;
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,8 +87,8 @@ public:
|
||||
{
|
||||
public:
|
||||
fetchInventoryResponder(const LLSD& request_sd) : mRequestSD(request_sd) {};
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_inventory; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return fetchInventoryResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "fetchInventoryResponder"; }
|
||||
|
||||
@@ -393,21 +393,21 @@ class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInvento
|
||||
{
|
||||
public:
|
||||
LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {};
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return inventoryModelFetchItemResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLInventoryModelFetchItemResponder"; }
|
||||
};
|
||||
|
||||
void LLInventoryModelFetchItemResponder::result( const LLSD& content )
|
||||
void LLInventoryModelFetchItemResponder::httpSuccess(void)
|
||||
{
|
||||
LLInventoryModel::fetchInventoryResponder::result(content);
|
||||
LLInventoryModel::fetchInventoryResponder::httpSuccess();
|
||||
LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
|
||||
}
|
||||
|
||||
void LLInventoryModelFetchItemResponder::error( U32 status, const std::string& reason )
|
||||
void LLInventoryModelFetchItemResponder::httpFailure(void)
|
||||
{
|
||||
LLInventoryModel::fetchInventoryResponder::error(status, reason);
|
||||
LLInventoryModel::fetchInventoryResponder::httpFailure();
|
||||
LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
|
||||
}
|
||||
|
||||
@@ -418,8 +418,8 @@ class LLInventoryModelFetchDescendentsResponder : public LLHTTPClient::Responder
|
||||
mRequestSD(request_sd),
|
||||
mRecursiveCatUUIDs(recursive_cats)
|
||||
{};
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_inventory; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return inventoryModelFetchDescendentsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLInventoryModelFetchDescendentsResponder"; }
|
||||
@@ -432,14 +432,14 @@ private:
|
||||
};
|
||||
|
||||
// If we get back a normal response, handle it here.
|
||||
void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
|
||||
void LLInventoryModelFetchDescendentsResponder::httpSuccess(void)
|
||||
{
|
||||
LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
|
||||
if (content.has("folders"))
|
||||
if (mContent.has("folders"))
|
||||
{
|
||||
|
||||
for(LLSD::array_const_iterator folder_it = content["folders"].beginArray();
|
||||
folder_it != content["folders"].endArray();
|
||||
for(LLSD::array_const_iterator folder_it = mContent["folders"].beginArray();
|
||||
folder_it != mContent["folders"].endArray();
|
||||
++folder_it)
|
||||
{
|
||||
LLSD folder_sd = *folder_it;
|
||||
@@ -535,10 +535,10 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
|
||||
}
|
||||
}
|
||||
|
||||
if (content.has("bad_folders"))
|
||||
if (mContent.has("bad_folders"))
|
||||
{
|
||||
for(LLSD::array_const_iterator folder_it = content["bad_folders"].beginArray();
|
||||
folder_it != content["bad_folders"].endArray();
|
||||
for(LLSD::array_const_iterator folder_it = mContent["bad_folders"].beginArray();
|
||||
folder_it != mContent["bad_folders"].endArray();
|
||||
++folder_it)
|
||||
{
|
||||
LLSD folder_sd = *folder_it;
|
||||
@@ -561,16 +561,16 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
|
||||
}
|
||||
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
void LLInventoryModelFetchDescendentsResponder::error(U32 status, const std::string& reason)
|
||||
void LLInventoryModelFetchDescendentsResponder::httpFailure(void)
|
||||
{
|
||||
LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
|
||||
|
||||
llinfos << "LLInventoryModelFetchDescendentsResponder::error "
|
||||
<< status << ": " << reason << llendl;
|
||||
<< mStatus << ": " << mReason << llendl;
|
||||
|
||||
fetcher->incrFetchCount(-1);
|
||||
|
||||
if (is_internal_http_error_that_warrants_a_retry(status)) // timed out
|
||||
if (is_internal_http_error_that_warrants_a_retry(mStatus)) // timed out
|
||||
{
|
||||
for(LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray();
|
||||
folder_it != mRequestSD["folders"].endArray();
|
||||
|
||||
@@ -42,11 +42,11 @@
|
||||
#include "llsdserialize.h"
|
||||
|
||||
//virtual
|
||||
void LLMapLayerResponder::result(const LLSD& result)
|
||||
void LLMapLayerResponder::httpSuccess(void)
|
||||
{
|
||||
llinfos << "LLMapLayerResponder::result from capabilities" << llendl;
|
||||
llinfos << "LLMapLayerResponder::mContent from capabilities" << llendl;
|
||||
|
||||
S32 agent_flags = result["AgentData"]["Flags"];
|
||||
S32 agent_flags = mContent["AgentData"]["Flags"];
|
||||
U32 layer = flagsToLayer(agent_flags);
|
||||
|
||||
if (layer != SIM_LAYER_COMPOSITE)
|
||||
@@ -60,7 +60,7 @@ void LLMapLayerResponder::result(const LLSD& result)
|
||||
LLWorldMap::getInstance()->mMapLayers.clear();
|
||||
|
||||
LLSD::array_const_iterator iter;
|
||||
for(iter = result["LayerData"].beginArray(); iter != result["LayerData"].endArray(); ++iter)
|
||||
for(iter = mContent["LayerData"].beginArray(); iter != mContent["LayerData"].endArray(); ++iter)
|
||||
{
|
||||
const LLSD& layer_data = *iter;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ extern AIHTTPTimeoutPolicy mapLayerResponder_timeout;
|
||||
|
||||
class LLMapLayerResponder : public LLHTTPClient::ResponderWithResult
|
||||
{
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return mapLayerResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLMapLayerResponder"; }
|
||||
};
|
||||
|
||||
@@ -157,29 +157,29 @@ namespace LLMarketplaceImport
|
||||
class LLImportPostResponder : public LLHTTPClient::ResponderWithCompleted
|
||||
{
|
||||
public:
|
||||
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
|
||||
/*virtual*/ void httpCompleted(void)
|
||||
{
|
||||
slmPostTimer.stop();
|
||||
|
||||
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
|
||||
{
|
||||
llinfos << " SLM POST status: " << status << llendl;
|
||||
llinfos << " SLM POST reason: " << reason << llendl;
|
||||
llinfos << " SLM POST content: " << content.asString() << llendl;
|
||||
llinfos << " SLM POST status: " << mStatus << llendl;
|
||||
llinfos << " SLM POST reason: " << mReason << llendl;
|
||||
llinfos << " SLM POST content: " << mContent.asString() << llendl;
|
||||
llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl;
|
||||
}
|
||||
|
||||
// MAINT-2301 : we determined we can safely ignore that error in that context
|
||||
if (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)
|
||||
if (mStatus == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)
|
||||
{
|
||||
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
|
||||
{
|
||||
llinfos << " SLM POST : Ignoring time out status and treating it as success" << llendl;
|
||||
}
|
||||
status = MarketplaceErrorCodes::IMPORT_DONE;
|
||||
mStatus = MarketplaceErrorCodes::IMPORT_DONE;
|
||||
}
|
||||
|
||||
if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST)
|
||||
if (mStatus >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST)
|
||||
{
|
||||
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
|
||||
{
|
||||
@@ -188,10 +188,10 @@ namespace LLMarketplaceImport
|
||||
sMarketplaceCookie.clear();
|
||||
}
|
||||
|
||||
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
|
||||
sImportInProgress = (mStatus == MarketplaceErrorCodes::IMPORT_DONE);
|
||||
sImportPostPending = false;
|
||||
sImportResultStatus = status;
|
||||
sImportId = content;
|
||||
sImportResultStatus = mStatus;
|
||||
sImportId = mContent;
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return MPImportPostResponder_timeout; }
|
||||
@@ -203,9 +203,9 @@ namespace LLMarketplaceImport
|
||||
public:
|
||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||
/*virtual*/ void completedHeaders(void)
|
||||
{
|
||||
if (status == HTTP_OK)
|
||||
if (mStatus == HTTP_OK)
|
||||
{
|
||||
std::string value = get_cookie("_slm_session");
|
||||
if (!value.empty())
|
||||
@@ -219,39 +219,39 @@ namespace LLMarketplaceImport
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
|
||||
/*virtual*/ void httpCompleted(void)
|
||||
{
|
||||
slmGetTimer.stop();
|
||||
|
||||
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
|
||||
{
|
||||
llinfos << " SLM GET status: " << status << llendl;
|
||||
llinfos << " SLM GET reason: " << reason << llendl;
|
||||
llinfos << " SLM GET content: " << content.asString() << llendl;
|
||||
llinfos << " SLM GET status: " << mStatus << llendl;
|
||||
llinfos << " SLM GET reason: " << mReason << llendl;
|
||||
llinfos << " SLM GET content: " << mContent.asString() << llendl;
|
||||
llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
|
||||
}
|
||||
|
||||
// MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS : Happens when trying to import objects with wrong permissions
|
||||
// ACME-1221 : Do not clear the cookie on IMPORT_NOT_FOUND : Happens for newly created Merchant accounts that are initially empty
|
||||
if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) &&
|
||||
(status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) &&
|
||||
(status != MarketplaceErrorCodes::IMPORT_NOT_FOUND))
|
||||
if ((mStatus >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) &&
|
||||
(mStatus != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) &&
|
||||
(mStatus != MarketplaceErrorCodes::IMPORT_NOT_FOUND))
|
||||
{
|
||||
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
|
||||
{
|
||||
llinfos << " SLM GET clearing marketplace cookie due to client or server error (" << status << " / " << reason << ")." << llendl;
|
||||
llinfos << " SLM GET clearing marketplace cookie due to client or server error (" << mStatus << " / " << mReason << ")." << llendl;
|
||||
}
|
||||
sMarketplaceCookie.clear();
|
||||
}
|
||||
else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST))
|
||||
else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (mStatus >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST))
|
||||
{
|
||||
llinfos << " SLM GET : Got error status = " << status << ", but marketplace cookie not cleared." << llendl;
|
||||
llinfos << " SLM GET : Got error status = " << mStatus << ", but marketplace cookie not cleared." << llendl;
|
||||
}
|
||||
|
||||
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
|
||||
sImportInProgress = (mStatus == MarketplaceErrorCodes::IMPORT_PROCESSING);
|
||||
sImportGetPending = false;
|
||||
sImportResultStatus = status;
|
||||
sImportResults = content;
|
||||
sImportResultStatus = mStatus;
|
||||
sImportResults = mContent;
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return MPImportGetResponder_timeout; }
|
||||
|
||||
@@ -73,8 +73,8 @@ public:
|
||||
LLMaterialsResponder(const std::string& pMethod, const std::string& pCapabilityURL, CallbackFunction pCallback);
|
||||
virtual ~LLMaterialsResponder();
|
||||
|
||||
virtual void result(const LLSD& pContent);
|
||||
virtual void error(U32 pStatus, const std::string& pReason);
|
||||
virtual void httpSuccess(void);
|
||||
virtual void httpFailure(void);
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return materialsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLMaterialsResponder"; }
|
||||
@@ -96,18 +96,18 @@ LLMaterialsResponder::~LLMaterialsResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void LLMaterialsResponder::result(const LLSD& pContent)
|
||||
void LLMaterialsResponder::httpSuccess(void)
|
||||
{
|
||||
LL_DEBUGS("Materials") << LL_ENDL;
|
||||
mCallback(true, pContent);
|
||||
mCallback(true, mContent);
|
||||
}
|
||||
|
||||
void LLMaterialsResponder::error(U32 pStatus, const std::string& pReason)
|
||||
void LLMaterialsResponder::httpFailure(void)
|
||||
{
|
||||
LL_WARNS("Materials")
|
||||
<< "\n--------------------------------------------------------------------------\n"
|
||||
<< mMethod << " Error[" << pStatus << "] cannot access cap '" << MATERIALS_CAPABILITY_NAME
|
||||
<< "'\n with url '" << mCapabilityURL << "' because " << pReason
|
||||
<< mMethod << " Error[" << mStatus << "] cannot access cap '" << MATERIALS_CAPABILITY_NAME
|
||||
<< "'\n with url '" << mCapabilityURL << "' because " << mReason
|
||||
<< "\n--------------------------------------------------------------------------"
|
||||
<< LL_ENDL;
|
||||
|
||||
|
||||
@@ -564,7 +564,7 @@ LLMediaDataClient::Responder::Responder(const request_ptr_t &request)
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLMediaDataClient::Responder::error(U32 status, const std::string& reason)
|
||||
void LLMediaDataClient::Responder::httpFailure(void)
|
||||
{
|
||||
mRequest->stopTracking();
|
||||
|
||||
@@ -574,7 +574,7 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason)
|
||||
return;
|
||||
}
|
||||
|
||||
if (status == HTTP_SERVICE_UNAVAILABLE)
|
||||
if (mStatus == HTTP_SERVICE_UNAVAILABLE)
|
||||
{
|
||||
F32 retry_timeout = mRequest->getRetryTimerDelay();
|
||||
|
||||
@@ -596,13 +596,12 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string msg = boost::lexical_cast<std::string>(status) + ": " + reason;
|
||||
LL_WARNS("LLMediaDataClient") << *mRequest << " http error(" << msg << ")" << LL_ENDL;
|
||||
LL_WARNS("LLMediaDataClient") << *mRequest << " http error: " << dumpResponse() << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLMediaDataClient::Responder::result(const LLSD& content)
|
||||
void LLMediaDataClient::Responder::httpSuccess(void)
|
||||
{
|
||||
mRequest->stopTracking();
|
||||
|
||||
@@ -612,7 +611,7 @@ void LLMediaDataClient::Responder::result(const LLSD& content)
|
||||
return;
|
||||
}
|
||||
|
||||
LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " result : " << ll_print_sd(content) << LL_ENDL;
|
||||
LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " result : " << ll_print_sd(mContent) << LL_ENDL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -876,7 +875,7 @@ LLMediaDataClient::Responder *LLObjectMediaDataClient::RequestUpdate::createResp
|
||||
|
||||
|
||||
/*virtual*/
|
||||
void LLObjectMediaDataClient::Responder::result(const LLSD& content)
|
||||
void LLObjectMediaDataClient::Responder::httpSuccess(void)
|
||||
{
|
||||
getRequest()->stopTracking();
|
||||
|
||||
@@ -888,12 +887,12 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content)
|
||||
|
||||
// This responder is only used for GET requests, not UPDATE.
|
||||
|
||||
LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL;
|
||||
LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(mContent) << LL_ENDL;
|
||||
|
||||
// Look for an error
|
||||
if (content.has("error"))
|
||||
if (mContent.has("error"))
|
||||
{
|
||||
const LLSD &error = content["error"];
|
||||
const LLSD &error = mContent["error"];
|
||||
LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error getting media data for object: code=" <<
|
||||
error["code"].asString() << ": " << error["message"].asString() << LL_ENDL;
|
||||
|
||||
@@ -902,7 +901,7 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content)
|
||||
else
|
||||
{
|
||||
// Check the data
|
||||
const LLUUID &object_id = content[LLTextureEntry::OBJECT_ID_KEY];
|
||||
const LLUUID &object_id = mContent[LLTextureEntry::OBJECT_ID_KEY];
|
||||
if (object_id != getRequest()->getObject()->getID())
|
||||
{
|
||||
// NOT good, wrong object id!!
|
||||
@@ -911,8 +910,8 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content)
|
||||
}
|
||||
|
||||
// Otherwise, update with object media data
|
||||
getRequest()->getObject()->updateObjectMediaData(content[LLTextureEntry::OBJECT_MEDIA_DATA_KEY],
|
||||
content[LLTextureEntry::MEDIA_VERSION_KEY]);
|
||||
getRequest()->getObject()->updateObjectMediaData(mContent[LLTextureEntry::OBJECT_MEDIA_DATA_KEY],
|
||||
mContent[LLTextureEntry::MEDIA_VERSION_KEY]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1003,7 +1002,7 @@ LLMediaDataClient::Responder *LLObjectMediaNavigateClient::RequestNavigate::crea
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLObjectMediaNavigateClient::Responder::error(U32 status, const std::string& reason)
|
||||
void LLObjectMediaNavigateClient::Responder::httpFailure(void)
|
||||
{
|
||||
getRequest()->stopTracking();
|
||||
|
||||
@@ -1015,14 +1014,14 @@ void LLObjectMediaNavigateClient::Responder::error(U32 status, const std::string
|
||||
|
||||
// Bounce back (unless HTTP_SERVICE_UNAVAILABLE, in which case call base
|
||||
// class
|
||||
if (status == HTTP_SERVICE_UNAVAILABLE)
|
||||
if (mStatus == HTTP_SERVICE_UNAVAILABLE)
|
||||
{
|
||||
LLMediaDataClient::Responder::error(status, reason);
|
||||
LLMediaDataClient::Responder::httpFailure();
|
||||
}
|
||||
else
|
||||
{
|
||||
// bounce the face back
|
||||
LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: http code=" << status << LL_ENDL;
|
||||
LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: http code=" << mStatus << LL_ENDL;
|
||||
const LLSD &payload = getRequest()->getPayload();
|
||||
// bounce the face back
|
||||
getRequest()->getObject()->mediaNavigateBounceBack((LLSD::Integer)payload[LLTextureEntry::TEXTURE_INDEX_KEY]);
|
||||
@@ -1030,7 +1029,7 @@ void LLObjectMediaNavigateClient::Responder::error(U32 status, const std::string
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLObjectMediaNavigateClient::Responder::result(const LLSD& content)
|
||||
void LLObjectMediaNavigateClient::Responder::httpSuccess(void)
|
||||
{
|
||||
getRequest()->stopTracking();
|
||||
|
||||
@@ -1040,11 +1039,11 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content)
|
||||
return;
|
||||
}
|
||||
|
||||
LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << ll_print_sd(content) << LL_ENDL;
|
||||
LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << ll_print_sd(mContent) << LL_ENDL;
|
||||
|
||||
if (content.has("error"))
|
||||
if (mContent.has("error"))
|
||||
{
|
||||
const LLSD &error = content["error"];
|
||||
const LLSD &error = mContent["error"];
|
||||
int error_code = error["code"];
|
||||
|
||||
if (ERROR_PERMISSION_DENIED_CODE == error_code)
|
||||
@@ -1065,6 +1064,6 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content)
|
||||
else
|
||||
{
|
||||
// No action required.
|
||||
LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " result : " << ll_print_sd(content) << LL_ENDL;
|
||||
LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " result : " << ll_print_sd(mContent) << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,9 +197,9 @@ protected:
|
||||
|
||||
Responder(const request_ptr_t &request);
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
virtual void error(U32 status, const std::string& reason);
|
||||
virtual void httpFailure(void);
|
||||
//If we get back a normal response, handle it here. Default just logs it.
|
||||
virtual void result(const LLSD& content);
|
||||
virtual void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return mediaDataClientResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLMediaDataClientResponder"; }
|
||||
|
||||
@@ -348,7 +348,7 @@ protected:
|
||||
public:
|
||||
Responder(const request_ptr_t &request)
|
||||
: LLMediaDataClient::Responder(request) {}
|
||||
virtual void result(const LLSD &content);
|
||||
virtual void httpSuccess(void);
|
||||
};
|
||||
private:
|
||||
// The Get/Update data client needs a second queue to avoid object updates starving load-ins.
|
||||
@@ -404,8 +404,8 @@ protected:
|
||||
public:
|
||||
Responder(const request_ptr_t &request)
|
||||
: LLMediaDataClient::Responder(request) {}
|
||||
virtual void error(U32 status, const std::string& reason);
|
||||
virtual void result(const LLSD &content);
|
||||
virtual void httpFailure(void);
|
||||
virtual void httpSuccess(void);
|
||||
private:
|
||||
void mediaNavigateBounceBack();
|
||||
};
|
||||
|
||||
@@ -240,9 +240,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer);
|
||||
virtual void completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer);
|
||||
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_mesh; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return meshHeaderResponder_timeout; }
|
||||
@@ -279,9 +278,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer);
|
||||
virtual void completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer);
|
||||
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_mesh; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return meshLODResponder_timeout; }
|
||||
@@ -314,9 +312,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer);
|
||||
virtual void completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer);
|
||||
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_mesh; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return meshSkinInfoResponder_timeout; }
|
||||
@@ -349,9 +346,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer);
|
||||
virtual void completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer);
|
||||
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_mesh; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return meshDecompositionResponder_timeout; }
|
||||
@@ -384,9 +380,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer);
|
||||
virtual void completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer);
|
||||
|
||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_mesh; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return meshPhysicsShapeResponder_timeout; }
|
||||
@@ -459,11 +454,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void completed(U32 status,
|
||||
const std::string& reason,
|
||||
const LLSD& content)
|
||||
virtual void httpCompleted(void)
|
||||
{
|
||||
LLSD cc = content;
|
||||
LLSD cc = mContent;
|
||||
if (gSavedSettings.getS32("MeshUploadFakeErrors")&1)
|
||||
{
|
||||
cc = llsd_from_file("fake_upload_error.xml");
|
||||
@@ -473,7 +466,7 @@ public:
|
||||
|
||||
LLWholeModelFeeObserver* observer = mObserverHandle.get();
|
||||
|
||||
if (isGoodStatus(status) &&
|
||||
if (isGoodStatus(mStatus) &&
|
||||
cc["state"].asString() == "upload")
|
||||
{
|
||||
mWholeModelUploadURL = cc["uploader"].asString();
|
||||
@@ -487,12 +480,12 @@ public:
|
||||
else
|
||||
{
|
||||
llwarns << "fee request failed" << llendl;
|
||||
log_upload_error(status,cc,"fee",mModelData["name"]);
|
||||
log_upload_error(mStatus,cc,"fee",mModelData["name"]);
|
||||
mWholeModelUploadURL = "";
|
||||
|
||||
if (observer)
|
||||
{
|
||||
observer->setModelPhysicsFeeErrorStatus(status, reason);
|
||||
observer->setModelPhysicsFeeErrorStatus(mStatus, mReason);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -517,11 +510,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void completed(U32 status,
|
||||
const std::string& reason,
|
||||
const LLSD& content)
|
||||
virtual void httpCompleted(void)
|
||||
{
|
||||
LLSD cc = content;
|
||||
LLSD cc = mContent;
|
||||
if (gSavedSettings.getS32("MeshUploadFakeErrors")&2)
|
||||
{
|
||||
cc = llsd_from_file("fake_upload_error.xml");
|
||||
@@ -533,7 +524,7 @@ public:
|
||||
|
||||
// requested "mesh" asset type isn't actually the type
|
||||
// of the resultant object, fix it up here.
|
||||
if (isGoodStatus(status) &&
|
||||
if (isGoodStatus(mStatus) &&
|
||||
cc["state"].asString() == "complete")
|
||||
{
|
||||
mModelData["asset_type"] = "object";
|
||||
@@ -548,7 +539,7 @@ public:
|
||||
{
|
||||
llwarns << "upload failed" << llendl;
|
||||
std::string model_name = mModelData["name"].asString();
|
||||
log_upload_error(status,cc,"upload",model_name);
|
||||
log_upload_error(mStatus,cc,"upload",model_name);
|
||||
|
||||
if (observer)
|
||||
{
|
||||
@@ -1887,9 +1878,8 @@ void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
|
||||
|
||||
}
|
||||
|
||||
void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
void LLMeshLODResponder::completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
mProcessed = true;
|
||||
|
||||
@@ -1901,14 +1891,14 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
|
||||
|
||||
S32 data_size = buffer->countAfter(channels.in(), NULL);
|
||||
|
||||
if (status < 200 || status >= 400)
|
||||
if (mStatus < 200 || mStatus >= 400)
|
||||
{
|
||||
llwarns << status << ": " << reason << llendl;
|
||||
llwarns << mStatus << ": " << mReason << llendl;
|
||||
}
|
||||
|
||||
if (data_size < (S32)mRequestedBytes)
|
||||
{
|
||||
if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE)
|
||||
if (is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE)
|
||||
{ //timeout or service unavailable, try again
|
||||
llwarns << "Timeout or service unavailable, retrying." << llendl;
|
||||
LLMeshRepository::sHTTPRetryCount++;
|
||||
@@ -1916,8 +1906,8 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << status << llendl;
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << mStatus << llendl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1951,9 +1941,8 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
void LLMeshSkinInfoResponder::completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
mProcessed = true;
|
||||
|
||||
@@ -1965,14 +1954,14 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason
|
||||
|
||||
S32 data_size = buffer->countAfter(channels.in(), NULL);
|
||||
|
||||
if (status < 200 || status >= 400)
|
||||
if (mStatus < 200 || mStatus >= 400)
|
||||
{
|
||||
llwarns << status << ": " << reason << llendl;
|
||||
llwarns << mStatus << ": " << mReason << llendl;
|
||||
}
|
||||
|
||||
if (data_size < (S32)mRequestedBytes)
|
||||
{
|
||||
if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE)
|
||||
if (is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE)
|
||||
{ //timeout or service unavailable, try again
|
||||
llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl;
|
||||
LLMeshRepository::sHTTPRetryCount++;
|
||||
@@ -1980,8 +1969,8 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << status << llendl;
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << mStatus << llendl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2015,9 +2004,8 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
void LLMeshDecompositionResponder::completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
mProcessed = true;
|
||||
|
||||
@@ -2028,14 +2016,14 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r
|
||||
|
||||
S32 data_size = buffer->countAfter(channels.in(), NULL);
|
||||
|
||||
if (status < 200 || status >= 400)
|
||||
if (mStatus < 200 || mStatus >= 400)
|
||||
{
|
||||
llwarns << status << ": " << reason << llendl;
|
||||
llwarns << mStatus << ": " << mReason << llendl;
|
||||
}
|
||||
|
||||
if (data_size < (S32)mRequestedBytes)
|
||||
{
|
||||
if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE)
|
||||
if (is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE)
|
||||
{ //timeout or service unavailable, try again
|
||||
llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl;
|
||||
LLMeshRepository::sHTTPRetryCount++;
|
||||
@@ -2043,8 +2031,8 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << status << llendl;
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << mStatus << llendl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2078,9 +2066,8 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
void LLMeshPhysicsShapeResponder::completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
mProcessed = true;
|
||||
|
||||
@@ -2092,14 +2079,14 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re
|
||||
|
||||
S32 data_size = buffer->countAfter(channels.in(), NULL);
|
||||
|
||||
if (status < 200 || status >= 400)
|
||||
if (mStatus < 200 || mStatus >= 400)
|
||||
{
|
||||
llwarns << status << ": " << reason << llendl;
|
||||
llwarns << mStatus << ": " << mReason << llendl;
|
||||
}
|
||||
|
||||
if (data_size < (S32)mRequestedBytes)
|
||||
{
|
||||
if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE)
|
||||
if (is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE)
|
||||
{ //timeout or service unavailable, try again
|
||||
llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl;
|
||||
LLMeshRepository::sHTTPRetryCount++;
|
||||
@@ -2107,8 +2094,8 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << status << llendl;
|
||||
llassert(is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint
|
||||
llwarns << "Unhandled status " << mStatus << llendl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2142,9 +2129,8 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
void LLMeshHeaderResponder::completedRaw(LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
mProcessed = true;
|
||||
|
||||
@@ -2154,11 +2140,11 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
|
||||
return;
|
||||
}
|
||||
|
||||
if (status < 200 || status >= 400)
|
||||
if (mStatus < 200 || mStatus >= 400)
|
||||
{
|
||||
//llwarns
|
||||
// << "Header responder failed with status: "
|
||||
// << status << ": " << reason << llendl;
|
||||
// << mStatus << ": " << mReason << llendl;
|
||||
|
||||
// 503 (service unavailable) or HTTP_INTERNAL_ERROR_*'s.
|
||||
// can be due to server load and can be retried
|
||||
@@ -2167,9 +2153,9 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
|
||||
// and (somewhat more optional than the others) retries
|
||||
// again after some set period of time
|
||||
|
||||
llassert(status == HTTP_NOT_FOUND || status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || is_internal_http_error_that_warrants_a_retry(status));
|
||||
llassert(mStatus == HTTP_NOT_FOUND || mStatus == HTTP_SERVICE_UNAVAILABLE || mStatus == HTTP_REQUEST_TIME_OUT || is_internal_http_error_that_warrants_a_retry(mStatus));
|
||||
|
||||
if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE)
|
||||
if (is_internal_http_error_that_warrants_a_retry(mStatus) || mStatus == HTTP_SERVICE_UNAVAILABLE)
|
||||
{ //retry
|
||||
llwarns << "Timeout or service unavailable, retrying." << llendl;
|
||||
LLMeshRepository::sHTTPRetryCount++;
|
||||
@@ -2181,7 +2167,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Unhandled status: " << status << llendl;
|
||||
llwarns << "Unhandled status: " << mStatus << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2205,7 +2191,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
|
||||
{
|
||||
llwarns
|
||||
<< "Unable to parse mesh header: "
|
||||
<< status << ": " << reason << llendl;
|
||||
<< mStatus << ": " << mReason << llendl;
|
||||
}
|
||||
else if (data && data_size > 0)
|
||||
{
|
||||
|
||||
@@ -688,7 +688,7 @@ public:
|
||||
}
|
||||
|
||||
//If we get back a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
//Ack'd the proposal initialization, now let's finish up.
|
||||
LLPanelGroupVoting::handleResponse(
|
||||
@@ -697,10 +697,10 @@ public:
|
||||
}
|
||||
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llinfos << "LLPanelGroupVotingResponder::error "
|
||||
<< status << ": " << reason << llendl;
|
||||
<< mStatus << ": " << mReason << llendl;
|
||||
|
||||
LLPanelGroupVoting::handleFailure(mGroupID);
|
||||
}
|
||||
@@ -721,20 +721,20 @@ public:
|
||||
}
|
||||
|
||||
//If we get back a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
//Ack'd the proposal initialization, now let's finish up.
|
||||
LLPanelGroupVoting::handleResponse(
|
||||
mGroupID,
|
||||
LLPanelGroupVoting::BALLOT,
|
||||
content["voted"].asBoolean());
|
||||
mContent["voted"].asBoolean());
|
||||
}
|
||||
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llinfos << "LLPanelGroupVotingResponder::error "
|
||||
<< status << ": " << reason << llendl;
|
||||
<< mStatus << ": " << mReason << llendl;
|
||||
|
||||
LLPanelGroupVoting::handleFailure(mGroupID);
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ public:
|
||||
NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly);
|
||||
virtual ~NavMeshStatusResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshStatusResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "NavMeshStatusResponder"; }
|
||||
|
||||
@@ -140,8 +140,8 @@ public:
|
||||
NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr);
|
||||
virtual ~NavMeshResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "NavMeshResponder"; }
|
||||
|
||||
@@ -163,8 +163,8 @@ public:
|
||||
AgentStateResponder(const std::string &pCapabilityURL);
|
||||
virtual ~AgentStateResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return agentStateResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "AgentStateResponder"; }
|
||||
|
||||
@@ -184,8 +184,8 @@ public:
|
||||
NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback);
|
||||
virtual ~NavMeshRebakeResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return navMeshRebakeResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "NavMeshRebakeResponder"; }
|
||||
|
||||
@@ -245,8 +245,8 @@ public:
|
||||
ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
|
||||
virtual ~ObjectLinksetsResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string &pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return objectLinksetsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "ObjectLinksetsResponder"; }
|
||||
|
||||
@@ -266,8 +266,8 @@ public:
|
||||
TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
|
||||
virtual ~TerrainLinksetsResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string &pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return terrainLinksetsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "TerrainLinksetsResponder"; }
|
||||
|
||||
@@ -287,8 +287,8 @@ public:
|
||||
CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback);
|
||||
virtual ~CharactersResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string &pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return charactersResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "CharactersResponder"; }
|
||||
|
||||
@@ -813,15 +813,15 @@ NavMeshStatusResponder::~NavMeshStatusResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void NavMeshStatusResponder::result(const LLSD &pContent)
|
||||
void NavMeshStatusResponder::httpSuccess(void)
|
||||
{
|
||||
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent);
|
||||
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, mContent);
|
||||
LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
|
||||
}
|
||||
|
||||
void NavMeshStatusResponder::error(U32 pStatus, const std::string& pReason)
|
||||
void NavMeshStatusResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
|
||||
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID);
|
||||
LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
|
||||
}
|
||||
@@ -841,14 +841,14 @@ NavMeshResponder::~NavMeshResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void NavMeshResponder::result(const LLSD &pContent)
|
||||
void NavMeshResponder::httpSuccess(void)
|
||||
{
|
||||
mNavMeshPtr->handleNavMeshResult(pContent, mNavMeshVersion);
|
||||
mNavMeshPtr->handleNavMeshResult(mContent, mNavMeshVersion);
|
||||
}
|
||||
|
||||
void NavMeshResponder::error(U32 pStatus, const std::string& pReason)
|
||||
void NavMeshResponder::httpFailure(void)
|
||||
{
|
||||
mNavMeshPtr->handleNavMeshError(pStatus, pReason, mCapabilityURL, mNavMeshVersion);
|
||||
mNavMeshPtr->handleNavMeshError(mStatus, mReason, mCapabilityURL, mNavMeshVersion);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -863,17 +863,17 @@ AgentStateResponder::~AgentStateResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void AgentStateResponder::result(const LLSD &pContent)
|
||||
void AgentStateResponder::httpSuccess(void)
|
||||
{
|
||||
llassert(pContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD));
|
||||
llassert(pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean());
|
||||
BOOL canRebakeRegion = pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean();
|
||||
llassert(mContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD));
|
||||
llassert(mContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean());
|
||||
BOOL canRebakeRegion = mContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean();
|
||||
LLPathfindingManager::getInstance()->handleAgentState(canRebakeRegion);
|
||||
}
|
||||
|
||||
void AgentStateResponder::error(U32 pStatus, const std::string &pReason)
|
||||
void AgentStateResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
|
||||
LLPathfindingManager::getInstance()->handleAgentState(FALSE);
|
||||
}
|
||||
|
||||
@@ -891,14 +891,14 @@ NavMeshRebakeResponder::~NavMeshRebakeResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void NavMeshRebakeResponder::result(const LLSD &pContent)
|
||||
void NavMeshRebakeResponder::httpSuccess(void)
|
||||
{
|
||||
mRebakeNavMeshCallback(true);
|
||||
}
|
||||
|
||||
void NavMeshRebakeResponder::error(U32 pStatus, const std::string &pReason)
|
||||
void NavMeshRebakeResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
|
||||
mRebakeNavMeshCallback(false);
|
||||
}
|
||||
|
||||
@@ -997,14 +997,14 @@ ObjectLinksetsResponder::~ObjectLinksetsResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void ObjectLinksetsResponder::result(const LLSD &pContent)
|
||||
void ObjectLinksetsResponder::httpSuccess(void)
|
||||
{
|
||||
mLinksetsResponsderPtr->handleObjectLinksetsResult(pContent);
|
||||
mLinksetsResponsderPtr->handleObjectLinksetsResult(mContent);
|
||||
}
|
||||
|
||||
void ObjectLinksetsResponder::error(U32 pStatus, const std::string &pReason)
|
||||
void ObjectLinksetsResponder::httpFailure(void)
|
||||
{
|
||||
mLinksetsResponsderPtr->handleObjectLinksetsError(pStatus, pReason, mCapabilityURL);
|
||||
mLinksetsResponsderPtr->handleObjectLinksetsError(mStatus, mReason, mCapabilityURL);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -1021,14 +1021,14 @@ TerrainLinksetsResponder::~TerrainLinksetsResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void TerrainLinksetsResponder::result(const LLSD &pContent)
|
||||
void TerrainLinksetsResponder::httpSuccess(void)
|
||||
{
|
||||
mLinksetsResponsderPtr->handleTerrainLinksetsResult(pContent);
|
||||
mLinksetsResponsderPtr->handleTerrainLinksetsResult(mContent);
|
||||
}
|
||||
|
||||
void TerrainLinksetsResponder::error(U32 pStatus, const std::string &pReason)
|
||||
void TerrainLinksetsResponder::httpFailure(void)
|
||||
{
|
||||
mLinksetsResponsderPtr->handleTerrainLinksetsError(pStatus, pReason, mCapabilityURL);
|
||||
mLinksetsResponsderPtr->handleTerrainLinksetsError(mStatus, mReason, mCapabilityURL);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -1046,15 +1046,15 @@ CharactersResponder::~CharactersResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void CharactersResponder::result(const LLSD &pContent)
|
||||
void CharactersResponder::httpSuccess(void)
|
||||
{
|
||||
LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(pContent));
|
||||
LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(mContent));
|
||||
mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr);
|
||||
}
|
||||
|
||||
void CharactersResponder::error(U32 pStatus, const std::string &pReason)
|
||||
void CharactersResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
|
||||
llwarns << "error with request to URL '" << mCapabilityURL << "' because " << mReason << " (statusCode:" << mStatus << ")" << llendl;
|
||||
|
||||
LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList());
|
||||
mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr);
|
||||
|
||||
@@ -46,16 +46,15 @@ class LLProductInfoRequestResponder : public LLHTTPClient::ResponderWithResult
|
||||
{
|
||||
public:
|
||||
//If we get back a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
LLProductInfoRequestManager::instance().setSkuDescriptions(content);
|
||||
LLProductInfoRequestManager::instance().setSkuDescriptions(mContent);
|
||||
}
|
||||
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "LLProductInfoRequest::error("
|
||||
<< status << ": " << reason << ")" << llendl;
|
||||
llwarns << "httpFailure: " << dumpResponse() << llendl;
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return productInfoRequestResponder_timeout; }
|
||||
|
||||
@@ -53,9 +53,9 @@ LLRemoteParcelRequestResponder::LLRemoteParcelRequestResponder(LLHandle<LLRemote
|
||||
|
||||
//If we get back a normal response, handle it here
|
||||
//virtual
|
||||
void LLRemoteParcelRequestResponder::result(const LLSD& content)
|
||||
void LLRemoteParcelRequestResponder::httpSuccess(void)
|
||||
{
|
||||
LLUUID parcel_id = content["parcel_id"];
|
||||
LLUUID parcel_id = mContent["parcel_id"];
|
||||
|
||||
// Panel inspecting the information may be closed and destroyed
|
||||
// before this response is received.
|
||||
@@ -68,17 +68,16 @@ void LLRemoteParcelRequestResponder::result(const LLSD& content)
|
||||
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
//virtual
|
||||
void LLRemoteParcelRequestResponder::error(U32 status, const std::string& reason)
|
||||
void LLRemoteParcelRequestResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "LLRemoteParcelRequest::error("
|
||||
<< status << ": " << reason << ")" << llendl;
|
||||
llinfos << "httpFailure: " << dumpResponse() << llendl;
|
||||
|
||||
// Panel inspecting the information may be closed and destroyed
|
||||
// before this response is received.
|
||||
LLRemoteParcelInfoObserver* observer = mObserverHandle.get();
|
||||
if (observer)
|
||||
{
|
||||
observer->setErrorStatus(status, reason);
|
||||
observer->setErrorStatus(mStatus, mReason);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,10 +49,10 @@ public:
|
||||
LLRemoteParcelRequestResponder(LLHandle<LLRemoteParcelInfoObserver> observer_handle);
|
||||
|
||||
//If we get back a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return remoteParcelRequestResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLRemoteParcelRequestResponder"; }
|
||||
|
||||
|
||||
@@ -287,9 +287,9 @@ public:
|
||||
mSessionID = session_id;
|
||||
}
|
||||
|
||||
virtual void error(U32 status, const std::string& reason)
|
||||
virtual void httpFailure(void)
|
||||
{
|
||||
llwarns << status << ": " << reason << llendl;
|
||||
llwarns << mStatus << ": " << mReason << llendl;
|
||||
|
||||
if ( gIMMgr )
|
||||
{
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
|
||||
//403 == you're not a mod
|
||||
//should be disabled if you're not a moderator
|
||||
if ( 403 == status )
|
||||
if ( 403 == mStatus )
|
||||
{
|
||||
floaterp->showSessionEventError(
|
||||
"mute",
|
||||
@@ -876,8 +876,8 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
|
||||
}
|
||||
}
|
||||
/*prep#
|
||||
virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
|
||||
llwarns << "ModerationResponder error [status:" << status << "]: " << content << llendl;
|
||||
virtual void httpFailure(void)
|
||||
llwarns << "httpFailure: " << dumpResponse() << llendl;
|
||||
*/
|
||||
void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id)
|
||||
{
|
||||
|
||||
@@ -345,11 +345,11 @@ public:
|
||||
|
||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers) {
|
||||
/*virtual*/ void completedHeaders(void) {
|
||||
LL_DEBUGS("Texture") << "HTTP HEADERS COMPLETE: " << mID << LL_ENDL;
|
||||
|
||||
std::string rangehdr;
|
||||
if (headers.getFirstValue("content-range", rangehdr))
|
||||
if (mReceivedHeaders.getFirstValue("content-range", rangehdr))
|
||||
{
|
||||
std::vector<std::string> tokens;
|
||||
boost::split(tokens,rangehdr,boost::is_any_of(" -/"));
|
||||
@@ -387,9 +387,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const buffer_ptr_t& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels,
|
||||
buffer_ptr_t const& buffer)
|
||||
{
|
||||
static LLCachedControl<bool> log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog");
|
||||
static LLCachedControl<bool> log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator");
|
||||
@@ -413,18 +412,18 @@ public:
|
||||
worker->lockWorkMutex();
|
||||
bool success = false;
|
||||
bool partial = false;
|
||||
if (HTTP_OK <= status && status < HTTP_MULTIPLE_CHOICES)
|
||||
if (HTTP_OK <= mStatus && mStatus < HTTP_MULTIPLE_CHOICES)
|
||||
{
|
||||
success = true;
|
||||
if (HTTP_PARTIAL_CONTENT == status) // partial information
|
||||
if (HTTP_PARTIAL_CONTENT == mStatus) // partial information
|
||||
{
|
||||
partial = true;
|
||||
}
|
||||
}
|
||||
if (!success)
|
||||
{
|
||||
worker->setGetStatus(status, reason);
|
||||
llwarns << "CURL GET FAILED, status:" << status << " reason:" << reason << llendl;
|
||||
worker->setGetStatus(mStatus, mReason);
|
||||
llwarns << "CURL GET FAILED, status:" << mStatus << " reason:" << mReason << llendl;
|
||||
}
|
||||
S32 data_size = worker->callbackHttpGet(mReplyOffset, mReplyLength, channels, buffer, partial, success);
|
||||
|
||||
@@ -3333,9 +3332,9 @@ class AssetReportHandler : public LLHTTPClient::ResponderWithCompleted
|
||||
public:
|
||||
|
||||
// Threads: Ttf
|
||||
/*virtual*/ virtual void completed(U32 status, std::string const& reason, LLSD const& content)
|
||||
/*virtual*/ virtual void httpCompleted(void)
|
||||
{
|
||||
if (status)
|
||||
if (mStatus)
|
||||
{
|
||||
LL_DEBUGS("Texture") << "Successfully delivered asset metrics to grid."
|
||||
<< LL_ENDL;
|
||||
@@ -3343,7 +3342,7 @@ public:
|
||||
else
|
||||
{
|
||||
LL_WARNS("Texture") << "Error delivering asset metrics to grid. Reason: "
|
||||
<< status << LL_ENDL;
|
||||
<< mStatus << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,17 +60,15 @@ public :
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
LL_WARNS("Translate") << "URL Request error: " << reason << LL_ENDL;
|
||||
handleFailure();
|
||||
}
|
||||
|
||||
/*virtual*/ void completedRaw(
|
||||
U32 status,
|
||||
const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
LLChannelDescriptors const& channels,
|
||||
LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
LLBufferStream istr(channels, buffer.get());
|
||||
|
||||
|
||||
@@ -39,25 +39,24 @@ LLUploadModelPremissionsResponder::LLUploadModelPremissionsResponder(const LLHan
|
||||
{
|
||||
}
|
||||
|
||||
void LLUploadModelPremissionsResponder::error(U32 status, const std::string& reason)
|
||||
void LLUploadModelPremissionsResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "LLUploadModelPremissionsResponder::error("
|
||||
<< status << ": " << reason << ")" << llendl;
|
||||
llwarns << "httpFailure: " << dumpResponse() << llendl;
|
||||
|
||||
LLUploadPermissionsObserver* observer = mObserverHandle.get();
|
||||
|
||||
if (observer)
|
||||
{
|
||||
observer->setPermissonsErrorStatus(status, reason);
|
||||
observer->setPermissonsErrorStatus(mStatus, mReason);
|
||||
}
|
||||
}
|
||||
|
||||
void LLUploadModelPremissionsResponder::result(const LLSD& content)
|
||||
void LLUploadModelPremissionsResponder::httpSuccess(void)
|
||||
{
|
||||
LLUploadPermissionsObserver* observer = mObserverHandle.get();
|
||||
|
||||
if (observer)
|
||||
{
|
||||
observer->onPermissionsReceived(content);
|
||||
observer->onPermissionsReceived(mContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ public:
|
||||
|
||||
LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer);
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return uploadModelPremissionsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLUploadModelPremissionsResponder"; }
|
||||
|
||||
|
||||
@@ -293,11 +293,11 @@ LLUserAuth::UserAuthcode LLUserAuth::authResponse()
|
||||
}
|
||||
|
||||
mLastTransferRateBPS = mResponder->transferRate();
|
||||
mErrorMessage = mResponder->reason();
|
||||
mErrorMessage = mResponder->getReason();
|
||||
|
||||
// if curl was ok, parse the download area.
|
||||
CURLcode result = mResponder->result_code();
|
||||
if (is_internal_http_error(mResponder->http_status()))
|
||||
if (is_internal_http_error(mResponder->getStatus()))
|
||||
{
|
||||
// result can be a meaningless CURLE_OK in the case of an internal error.
|
||||
result = CURLE_FAILED_INIT; // Just some random error to get the default case below.
|
||||
@@ -342,7 +342,7 @@ LLUserAuth::UserAuthcode LLUserAuth::parseResponse()
|
||||
XMLRPC_REQUEST response = mResponder->response();
|
||||
if(!response)
|
||||
{
|
||||
U32 status = mResponder->http_status();
|
||||
U32 status = mResponder->getStatus();
|
||||
// Is it an HTTP error?
|
||||
if (!(200 <= status && status < 400))
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ class LLSetDisplayNameResponder : public LLHTTPClient::ResponderIgnoreBody
|
||||
{
|
||||
public:
|
||||
// only care about errors
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD());
|
||||
LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots();
|
||||
|
||||
@@ -194,25 +194,25 @@ public:
|
||||
disconnectOwner();
|
||||
}
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||
/*virtual*/ void completedHeaders(void)
|
||||
{
|
||||
if ((200 <= status && status < 300) || status == 405) // Using HEAD may result in a 405 METHOD NOT ALLOWED, but still have the right Content-Type header.
|
||||
if ((200 <= mStatus && mStatus < 300) || mStatus == 405) // Using HEAD may result in a 405 METHOD NOT ALLOWED, but still have the right Content-Type header.
|
||||
{
|
||||
std::string media_type;
|
||||
if (headers.getFirstValue("content-type", media_type))
|
||||
if (mReceivedHeaders.getFirstValue("content-type", media_type))
|
||||
{
|
||||
std::string::size_type idx1 = media_type.find_first_of(";");
|
||||
std::string mime_type = media_type.substr(0, idx1);
|
||||
completeAny(status, mime_type);
|
||||
completeAny(mStatus, mime_type);
|
||||
return;
|
||||
}
|
||||
if (200 <= status && status < 300)
|
||||
if (200 <= mStatus && mStatus < 300)
|
||||
{
|
||||
llwarns << "LLMimeDiscoveryResponder::completedHeaders: OK HTTP status (" << status << ") but no Content-Type! Received headers: " << headers << llendl;
|
||||
llwarns << "LLMimeDiscoveryResponder::completedHeaders: OK HTTP status (" << mStatus << ") but no Content-Type! Received headers: " << mReceivedHeaders << llendl;
|
||||
}
|
||||
}
|
||||
llwarns << "LLMimeDiscoveryResponder::completedHeaders: Got status " << status << ". Using default mime-type: " << mDefaultMimeType << llendl;
|
||||
completeAny(status, mDefaultMimeType);
|
||||
llwarns << "LLMimeDiscoveryResponder::completedHeaders: Got status " << mStatus << ". Using default mime-type: " << mDefaultMimeType << llendl;
|
||||
completeAny(mStatus, mDefaultMimeType);
|
||||
}
|
||||
|
||||
void completeAny(U32 status, const std::string& mime_type)
|
||||
@@ -276,18 +276,14 @@ public:
|
||||
|
||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||
/*virtual*/ void completedHeaders(void)
|
||||
{
|
||||
LL_DEBUGS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL;
|
||||
LL_DEBUGS("MediaAuth") << headers << LL_ENDL;
|
||||
LL_DEBUGS("MediaAuth") << "status = " << mStatus << ", reason = " << mReason << LL_ENDL;
|
||||
LL_DEBUGS("MediaAuth") << mReceivedHeaders << LL_ENDL;
|
||||
LLViewerMedia::openIDCookieResponse(get_cookie("agni_sl_session_id"));
|
||||
}
|
||||
|
||||
/*virtual*/ void completedRaw(
|
||||
U32 status,
|
||||
const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
// This is just here to disable the default behavior (attempting to parse the response as llsd).
|
||||
// We don't care about the content of the response, only the set-cookie header.
|
||||
@@ -306,14 +302,14 @@ public:
|
||||
|
||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||
/*virtual*/ void completedHeaders(void)
|
||||
{
|
||||
LL_INFOS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL;
|
||||
LL_INFOS("MediaAuth") << headers << LL_ENDL;
|
||||
LL_INFOS("MediaAuth") << "status = " << mStatus << ", reason = " << mReason << LL_ENDL;
|
||||
LL_INFOS("MediaAuth") << mReceivedHeaders << LL_ENDL;
|
||||
|
||||
bool found = false;
|
||||
AIHTTPReceivedHeaders::range_type cookies;
|
||||
if (headers.getValues("set-cookie", cookies))
|
||||
if (mReceivedHeaders.getValues("set-cookie", cookies))
|
||||
{
|
||||
for (AIHTTPReceivedHeaders::iterator_type cookie = cookies.first; cookie != cookies.second; ++cookie)
|
||||
{
|
||||
@@ -337,11 +333,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void completedRaw(
|
||||
U32 status,
|
||||
const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const LLIOPipe::buffer_ptr_t& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, LLIOPipe::buffer_ptr_t const& buffer)
|
||||
{
|
||||
// This is just here to disable the default behavior (attempting to parse the response as llsd).
|
||||
// We don't care about the content of the response, only the set-cookie header.
|
||||
|
||||
@@ -3713,17 +3713,17 @@ void script_msg_api(const std::string& msg)
|
||||
class AuthHandler : public LLHTTPClient::ResponderWithCompleted
|
||||
{
|
||||
protected:
|
||||
/*virtual*/ void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
std::string content;
|
||||
decode_raw_body(status, reason, channels, buffer, content);
|
||||
if (status == HTTP_OK)
|
||||
decode_raw_body(channels, buffer, content);
|
||||
if (mStatus == HTTP_OK)
|
||||
{
|
||||
send_chat_from_viewer("AUTH:" + content, CHAT_TYPE_WHISPER, 427169570);
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Hippo AuthHandler: non-OK HTTP status " << status << " for URL " << mURL << " (" << reason << "). Error body: \"" << content << "\"." << llendl;
|
||||
llwarns << "Hippo AuthHandler: non-OK HTTP status " << mStatus << " for URL " << mURL << " (" << mReason << "). Error body: \"" << content << "\"." << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -738,28 +738,28 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns
|
||||
<< "Transport error requesting object cost "
|
||||
<< "HTTP status: " << statusNum << ", reason: "
|
||||
<< reason << "." << llendl;
|
||||
<< "HTTP status: " << mStatus << ", reason: "
|
||||
<< mReason << "." << llendl;
|
||||
|
||||
// TODO*: Error message to user
|
||||
// For now just clear the request from the pending list
|
||||
clear_object_list_pending_requests();
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if ( !content.isMap() || content.has("error") )
|
||||
if ( !mContent.isMap() || mContent.has("error") )
|
||||
{
|
||||
// Improper response or the request had an error,
|
||||
// show an error to the user?
|
||||
llwarns
|
||||
<< "Application level error when fetching object "
|
||||
<< "cost. Message: " << content["error"]["message"].asString()
|
||||
<< ", identifier: " << content["error"]["identifier"].asString()
|
||||
<< "cost. Message: " << mContent["error"]["message"].asString()
|
||||
<< ", identifier: " << mContent["error"]["identifier"].asString()
|
||||
<< llendl;
|
||||
|
||||
// TODO*: Adaptively adjust request size if the
|
||||
@@ -780,15 +780,15 @@ public:
|
||||
LLUUID object_id = iter->asUUID();
|
||||
|
||||
// Check to see if the request contains data for the object
|
||||
if ( content.has(iter->asString()) )
|
||||
if ( mContent.has(iter->asString()) )
|
||||
{
|
||||
F32 link_cost =
|
||||
content[iter->asString()]["linked_set_resource_cost"].asReal();
|
||||
mContent[iter->asString()]["linked_set_resource_cost"].asReal();
|
||||
F32 object_cost =
|
||||
content[iter->asString()]["resource_cost"].asReal();
|
||||
mContent[iter->asString()]["resource_cost"].asReal();
|
||||
|
||||
F32 physics_cost = content[iter->asString()]["physics_cost"].asReal();
|
||||
F32 link_physics_cost = content[iter->asString()]["linked_set_physics_cost"].asReal();
|
||||
F32 physics_cost = mContent[iter->asString()]["physics_cost"].asReal();
|
||||
F32 link_physics_cost = mContent[iter->asString()]["linked_set_physics_cost"].asReal();
|
||||
|
||||
gObjectList.updateObjectCost(object_id, object_cost, link_cost, physics_cost, link_physics_cost);
|
||||
}
|
||||
@@ -829,28 +829,28 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns
|
||||
<< "Transport error requesting object physics flags "
|
||||
<< "HTTP status: " << statusNum << ", reason: "
|
||||
<< reason << "." << llendl;
|
||||
<< "HTTP status: " << mStatus << ", reason: "
|
||||
<< mReason << "." << llendl;
|
||||
|
||||
// TODO*: Error message to user
|
||||
// For now just clear the request from the pending list
|
||||
clear_object_list_pending_requests();
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if ( !content.isMap() || content.has("error") )
|
||||
if ( !mContent.isMap() || mContent.has("error") )
|
||||
{
|
||||
// Improper response or the request had an error,
|
||||
// show an error to the user?
|
||||
llwarns
|
||||
<< "Application level error when fetching object "
|
||||
<< "physics flags. Message: " << content["error"]["message"].asString()
|
||||
<< ", identifier: " << content["error"]["identifier"].asString()
|
||||
<< "physics flags. Message: " << mContent["error"]["message"].asString()
|
||||
<< ", identifier: " << mContent["error"]["identifier"].asString()
|
||||
<< llendl;
|
||||
|
||||
// TODO*: Adaptively adjust request size if the
|
||||
@@ -871,9 +871,9 @@ public:
|
||||
LLUUID object_id = iter->asUUID();
|
||||
|
||||
// Check to see if the request contains data for the object
|
||||
if ( content.has(iter->asString()) )
|
||||
if ( mContent.has(iter->asString()) )
|
||||
{
|
||||
const LLSD& data = content[iter->asString()];
|
||||
const LLSD& data = mContent[iter->asString()];
|
||||
|
||||
S32 shape_type = data["PhysicsShapeType"].asInteger();
|
||||
|
||||
|
||||
@@ -224,9 +224,9 @@ public:
|
||||
virtual ~BaseCapabilitiesComplete()
|
||||
{ }
|
||||
|
||||
void error(U32 statusNum, const std::string& reason)
|
||||
void httpFailure(void)
|
||||
{
|
||||
LL_WARNS2("AppInit", "Capabilities") << statusNum << ": " << reason << LL_ENDL;
|
||||
LL_WARNS2("AppInit", "Capabilities") << mStatus << ": " << mReason << LL_ENDL;
|
||||
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if (regionp)
|
||||
{
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void result(const LLSD& content)
|
||||
void httpSuccess(void)
|
||||
{
|
||||
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if(!regionp) //region was removed
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
}
|
||||
|
||||
LLSD::map_const_iterator iter;
|
||||
for(iter = content.beginMap(); iter != content.endMap(); ++iter)
|
||||
for(iter = mContent.beginMap(); iter != mContent.endMap(); ++iter)
|
||||
{
|
||||
regionp->setCapability(iter->first, iter->second);
|
||||
LL_DEBUGS2("AppInit", "Capabilities") << "got capability for "
|
||||
@@ -1849,13 +1849,13 @@ public:
|
||||
{ }
|
||||
|
||||
|
||||
void error(U32 statusNum, const std::string& reason)
|
||||
void httpFailure(void)
|
||||
{
|
||||
LL_WARNS2("AppInit", "SimulatorFeatures") << statusNum << ": " << reason << LL_ENDL;
|
||||
LL_WARNS2("AppInit", "SimulatorFeatures") << mStatus << ": " << mReason << LL_ENDL;
|
||||
retry();
|
||||
}
|
||||
|
||||
void result(const LLSD& content)
|
||||
void httpSuccess(void)
|
||||
{
|
||||
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if(!regionp) //region is removed or responder is not created.
|
||||
@@ -1864,7 +1864,7 @@ public:
|
||||
return ;
|
||||
}
|
||||
|
||||
regionp->setSimulatorFeatures(content);
|
||||
regionp->setSimulatorFeatures(mContent);
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return simulatorFeaturesReceived_timeout; }
|
||||
@@ -1895,16 +1895,16 @@ public:
|
||||
: mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts)
|
||||
{}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
LL_WARNS2("AppInit", "GamingData") << statusNum << ": " << reason << LL_ENDL;
|
||||
LL_WARNS2("AppInit", "GamingData") << mStatus << ": " << mReason << LL_ENDL;
|
||||
retry();
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if(regionp) regionp->setGamingData(content);
|
||||
if(regionp) regionp->setGamingData(mContent);
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return gamingDataReceived_timeout; }
|
||||
|
||||
@@ -709,13 +709,13 @@ class ViewerStatsResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
ViewerStatsResponder() { }
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llinfos << "ViewerStatsResponder::error " << statusNum << " "
|
||||
<< reason << llendl;
|
||||
llinfos << "ViewerStatsResponder::error " << mStatus << " "
|
||||
<< mReason << llendl;
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
llinfos << "ViewerStatsResponder::result" << llendl;
|
||||
}
|
||||
|
||||
@@ -2314,7 +2314,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ void result(LLSD const& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
|
||||
if (mLiveSequence == mExpectedSequence)
|
||||
@@ -2322,9 +2322,9 @@ public:
|
||||
mReportingStarted = true;
|
||||
}
|
||||
}
|
||||
/*virtual*/ void error(U32 status, std::string const& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
LL_WARNS("Avatar") << "Failed " << status << " reason " << reason << LL_ENDL;
|
||||
LL_WARNS("Avatar") << "Failed " << mStatus << " reason " << mReason << LL_ENDL;
|
||||
}
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return appearanceChangeMetricsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "AppearanceChangeMetricsResponder"; }
|
||||
@@ -2490,9 +2490,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||
/*virtual*/ void completedHeaders(void)
|
||||
{
|
||||
if (isGoodStatus(status))
|
||||
if (isGoodStatus(mStatus))
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "status OK" << llendl;
|
||||
}
|
||||
@@ -2507,7 +2507,7 @@ public:
|
||||
}
|
||||
|
||||
// Error
|
||||
/*virtual*//* void error(U32 status, const std::string& reason)
|
||||
/*virtual*//* void httpFailure(void)
|
||||
{
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
|
||||
@@ -56,8 +56,8 @@ public:
|
||||
LLVoiceCallCapResponder(const LLUUID& session_id) : mSessionID(session_id) {};
|
||||
|
||||
// called with bad status codes
|
||||
virtual void error(U32 status, const std::string& reason);
|
||||
virtual void result(const LLSD& content);
|
||||
virtual void httpFailure(void);
|
||||
virtual void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return voiceCallCapResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLVoiceCallCapResponder"; }
|
||||
|
||||
@@ -66,14 +66,14 @@ private:
|
||||
};
|
||||
|
||||
|
||||
void LLVoiceCallCapResponder::error(U32 status, const std::string& reason)
|
||||
void LLVoiceCallCapResponder::httpFailure(void)
|
||||
{
|
||||
LL_WARNS("Voice") << "LLVoiceCallCapResponder error [status:"
|
||||
<< status << "]: " << reason << LL_ENDL;
|
||||
<< mStatus << "]: " << mReason << LL_ENDL;
|
||||
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID);
|
||||
if ( channelp )
|
||||
{
|
||||
if ( 403 == status )
|
||||
if ( 403 == mStatus )
|
||||
{
|
||||
//403 == no ability
|
||||
LLNotificationsUtil::add(
|
||||
@@ -90,22 +90,22 @@ void LLVoiceCallCapResponder::error(U32 status, const std::string& reason)
|
||||
}
|
||||
}
|
||||
|
||||
void LLVoiceCallCapResponder::result(const LLSD& content)
|
||||
void LLVoiceCallCapResponder::httpSuccess(void)
|
||||
{
|
||||
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID);
|
||||
if (channelp)
|
||||
{
|
||||
// *TODO: DEBUG SPAM
|
||||
LLSD::map_const_iterator iter;
|
||||
for(iter = content.beginMap(); iter != content.endMap(); ++iter)
|
||||
for(iter = mContent.beginMap(); iter != mContent.endMap(); ++iter)
|
||||
{
|
||||
LL_DEBUGS("Voice") << "LLVoiceCallCapResponder::result got "
|
||||
<< iter->first << LL_ENDL;
|
||||
}
|
||||
|
||||
channelp->setChannelInfo(
|
||||
content["voice_credentials"]["channel_uri"].asString(),
|
||||
content["voice_credentials"]["channel_credentials"].asString());
|
||||
mContent["voice_credentials"]["channel_uri"].asString(),
|
||||
mContent["voice_credentials"]["channel_credentials"].asString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,11 +122,11 @@ public:
|
||||
mRetries = retries;
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
LL_WARNS("Voice") << "ProvisionVoiceAccountRequest returned an error, "
|
||||
<< ( (mRetries > 0) ? "retrying" : "too many retries (giving up)" )
|
||||
<< status << "]: " << reason << LL_ENDL;
|
||||
<< mStatus << "]: " << mReason << LL_ENDL;
|
||||
|
||||
if ( mRetries > 0 )
|
||||
{
|
||||
@@ -138,24 +138,24 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
|
||||
std::string voice_sip_uri_hostname;
|
||||
std::string voice_account_server_uri;
|
||||
|
||||
LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << ll_pretty_print_sd(content) << LL_ENDL;
|
||||
LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << ll_pretty_print_sd(mContent) << LL_ENDL;
|
||||
|
||||
if(content.has("voice_sip_uri_hostname"))
|
||||
voice_sip_uri_hostname = content["voice_sip_uri_hostname"].asString();
|
||||
if(mContent.has("voice_sip_uri_hostname"))
|
||||
voice_sip_uri_hostname = mContent["voice_sip_uri_hostname"].asString();
|
||||
|
||||
// this key is actually misnamed -- it will be an entire URI, not just a hostname.
|
||||
if(content.has("voice_account_server_name"))
|
||||
voice_account_server_uri = content["voice_account_server_name"].asString();
|
||||
if(mContent.has("voice_account_server_name"))
|
||||
voice_account_server_uri = mContent["voice_account_server_name"].asString();
|
||||
|
||||
LLVivoxVoiceClient::getInstance()->login(
|
||||
content["username"].asString(),
|
||||
content["password"].asString(),
|
||||
mContent["username"].asString(),
|
||||
mContent["password"].asString(),
|
||||
voice_sip_uri_hostname,
|
||||
voice_account_server_uri);
|
||||
|
||||
@@ -188,8 +188,8 @@ class LLVivoxVoiceClientCapResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
LLVivoxVoiceClientCapResponder(LLVivoxVoiceClient::state requesting_state) : mRequestingState(requesting_state) {};
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason); // called with bad status codes
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return vivoxVoiceClientCapResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLVivoxVoiceClientCapResponder"; }
|
||||
|
||||
@@ -197,25 +197,25 @@ private:
|
||||
LLVivoxVoiceClient::state mRequestingState; // state
|
||||
};
|
||||
|
||||
void LLVivoxVoiceClientCapResponder::error(U32 status, const std::string& reason)
|
||||
void LLVivoxVoiceClientCapResponder::httpFailure(void)
|
||||
{
|
||||
LL_WARNS("Voice") << "LLVivoxVoiceClientCapResponder error [status:"
|
||||
<< status << "]: " << reason << LL_ENDL;
|
||||
<< mStatus << "]: " << mReason << LL_ENDL;
|
||||
LLVivoxVoiceClient::getInstance()->sessionTerminate();
|
||||
}
|
||||
|
||||
void LLVivoxVoiceClientCapResponder::result(const LLSD& content)
|
||||
void LLVivoxVoiceClientCapResponder::httpSuccess(void)
|
||||
{
|
||||
LLSD::map_const_iterator iter;
|
||||
|
||||
LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << ll_pretty_print_sd(content) << LL_ENDL;
|
||||
LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << ll_pretty_print_sd(mContent) << LL_ENDL;
|
||||
|
||||
std::string uri;
|
||||
std::string credentials;
|
||||
|
||||
if ( content.has("voice_credentials") )
|
||||
if ( mContent.has("voice_credentials") )
|
||||
{
|
||||
LLSD voice_credentials = content["voice_credentials"];
|
||||
LLSD voice_credentials = mContent["voice_credentials"];
|
||||
if ( voice_credentials.has("channel_uri") )
|
||||
{
|
||||
uri = voice_credentials["channel_uri"].asString();
|
||||
|
||||
@@ -69,20 +69,16 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ void completedRaw(
|
||||
U32 status,
|
||||
const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const buffer_ptr_t& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
LLBufferStream istr(channels, buffer.get());
|
||||
std::stringstream strstrm;
|
||||
strstrm << istr.rdbuf();
|
||||
const std::string body = strstrm.str();
|
||||
|
||||
if (status != 200)
|
||||
if (mStatus != HTTP_OK)
|
||||
{
|
||||
llwarns << "Failed to get upload config (" << status << ")" << llendl;
|
||||
llwarns << "Failed to get upload config (" << mStatus << ")" << llendl;
|
||||
LLWebProfile::reportImageUploadStatus(false);
|
||||
return;
|
||||
}
|
||||
@@ -133,15 +129,11 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::
|
||||
LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder);
|
||||
|
||||
public:
|
||||
/*virtual*/ void completedRaw(
|
||||
U32 status,
|
||||
const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const buffer_ptr_t& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
if (status != 200)
|
||||
if (mStatus != HTTP_OK)
|
||||
{
|
||||
llwarns << "Failed to upload image: " << status << " " << reason << llendl;
|
||||
llwarns << "Failed to upload image: " << mStatus << " " << mReason << llendl;
|
||||
LLWebProfile::reportImageUploadStatus(false);
|
||||
return;
|
||||
}
|
||||
@@ -173,35 +165,33 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde
|
||||
public:
|
||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||
|
||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& received_headers)
|
||||
/*virtual*/ void completedHeaders(void)
|
||||
{
|
||||
// Server abuses 303 status; Curl can't handle it because it tries to resent
|
||||
// the just uploaded data, which fails
|
||||
// (CURLE_SEND_FAIL_REWIND: Send failed since rewinding of the data stream failed).
|
||||
// Handle it manually.
|
||||
if (status == HTTP_SEE_OTHER)
|
||||
if (mStatus == HTTP_SEE_OTHER)
|
||||
{
|
||||
AIHTTPHeaders headers;
|
||||
headers.addHeader("Accept", "*/*");
|
||||
headers.addHeader("Cookie", LLWebProfile::getAuthCookie());
|
||||
headers.addHeader("User-Agent", LLViewerMedia::getCurrentUserAgent());
|
||||
std::string redir_url;
|
||||
received_headers.getFirstValue("location", redir_url);
|
||||
mReceivedHeaders.getFirstValue("location", redir_url);
|
||||
LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << LL_ENDL;
|
||||
LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers);
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Unexpected POST status: " << status << " " << reason << llendl;
|
||||
LL_DEBUGS("Snapshots") << "received_headers: [" << received_headers << "]" << LL_ENDL;
|
||||
llwarns << "Unexpected POST status: " << mStatus << " " << mReason << llendl;
|
||||
LL_DEBUGS("Snapshots") << "received_headers: [" << mReceivedHeaders << "]" << LL_ENDL;
|
||||
LLWebProfile::reportImageUploadStatus(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Override just to suppress warnings.
|
||||
/*virtual*/ void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const buffer_ptr_t& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ LLEnvironmentRequestResponder::LLEnvironmentRequestResponder()
|
||||
{
|
||||
mID = ++sCount;
|
||||
}
|
||||
/*virtual*/ void LLEnvironmentRequestResponder::result(const LLSD& unvalidated_content)
|
||||
/*virtual*/ void LLEnvironmentRequestResponder::httpSuccess(void)
|
||||
{
|
||||
LL_INFOS("WindlightCaps") << "Received region windlight settings" << LL_ENDL;
|
||||
|
||||
@@ -113,22 +113,22 @@ LLEnvironmentRequestResponder::LLEnvironmentRequestResponder()
|
||||
{
|
||||
LL_WARNS("WindlightCaps") << "Ignoring responder. Current region is invalid." << LL_ENDL;
|
||||
}
|
||||
else if (unvalidated_content[0]["regionID"].asUUID().isNull())
|
||||
else if (mContent[0]["regionID"].asUUID().isNull())
|
||||
{
|
||||
LL_WARNS("WindlightCaps") << "Ignoring responder. Response from invalid region." << LL_ENDL;
|
||||
}
|
||||
else if (unvalidated_content[0]["regionID"].asUUID() != gAgent.getRegion()->getRegionID())
|
||||
else if (mContent[0]["regionID"].asUUID() != gAgent.getRegion()->getRegionID())
|
||||
{
|
||||
LL_WARNS("WindlightCaps") << "Not in the region from where this data was received (wanting "
|
||||
<< gAgent.getRegion()->getRegionID() << " but got " << unvalidated_content[0]["regionID"].asUUID()
|
||||
<< gAgent.getRegion()->getRegionID() << " but got " << mContent[0]["regionID"].asUUID()
|
||||
<< ") - ignoring..." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLEnvManagerNew::getInstance()->onRegionSettingsResponse(unvalidated_content);
|
||||
LLEnvManagerNew::getInstance()->onRegionSettingsResponse(mContent);
|
||||
}
|
||||
}
|
||||
/*virtual*/ void LLEnvironmentRequestResponder::error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void LLEnvironmentRequestResponder::httpFailure(void)
|
||||
{
|
||||
LL_INFOS("WindlightCaps") << "Got an error, not using region windlight..." << LL_ENDL;
|
||||
LLEnvManagerNew::getInstance()->onRegionSettingsResponse(LLSD());
|
||||
@@ -174,33 +174,33 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
|
||||
/****
|
||||
* LLEnvironmentApplyResponder
|
||||
****/
|
||||
/*virtual*/ void LLEnvironmentApplyResponder::result(const LLSD& content)
|
||||
/*virtual*/ void LLEnvironmentApplyResponder::httpSuccess(void)
|
||||
{
|
||||
if (content["regionID"].asUUID() != gAgent.getRegion()->getRegionID())
|
||||
if (mContent["regionID"].asUUID() != gAgent.getRegion()->getRegionID())
|
||||
{
|
||||
LL_WARNS("WindlightCaps") << "No longer in the region where data was sent (currently "
|
||||
<< gAgent.getRegion()->getRegionID() << ", reply is from " << content["regionID"].asUUID()
|
||||
<< gAgent.getRegion()->getRegionID() << ", reply is from " << mContent["regionID"].asUUID()
|
||||
<< "); ignoring..." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
else if (content["success"].asBoolean())
|
||||
else if (mContent["success"].asBoolean())
|
||||
{
|
||||
LL_DEBUGS("WindlightCaps") << "Success in applying windlight settings to region " << content["regionID"].asUUID() << LL_ENDL;
|
||||
LL_DEBUGS("WindlightCaps") << "Success in applying windlight settings to region " << mContent["regionID"].asUUID() << LL_ENDL;
|
||||
LLEnvManagerNew::instance().onRegionSettingsApplyResponse(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! Reason from sim: " << content["fail_reason"].asString() << LL_ENDL;
|
||||
LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! Reason from sim: " << mContent["fail_reason"].asString() << LL_ENDL;
|
||||
LLSD args(LLSD::emptyMap());
|
||||
args["FAIL_REASON"] = content["fail_reason"].asString();
|
||||
args["FAIL_REASON"] = mContent["fail_reason"].asString();
|
||||
LLNotificationsUtil::add("WLRegionApplyFail", args);
|
||||
LLEnvManagerNew::instance().onRegionSettingsApplyResponse(false);
|
||||
}
|
||||
}
|
||||
/*virtual*/ void LLEnvironmentApplyResponder::error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void LLEnvironmentApplyResponder::httpFailure(void)
|
||||
{
|
||||
std::stringstream msg;
|
||||
msg << reason << " (Code " << status << ")";
|
||||
msg << mReason << " (Code " << mStatus << ")";
|
||||
|
||||
LL_WARNS("WindlightCaps") << "Couldn't apply windlight settings to region! Reason: " << msg.str() << LL_ENDL;
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ class LLEnvironmentRequestResponder: public LLHTTPClient::ResponderWithResult
|
||||
{
|
||||
LOG_CLASS(LLEnvironmentRequestResponder);
|
||||
public:
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return environmentRequestResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLEnvironmentRequestResponder"; }
|
||||
|
||||
@@ -98,9 +98,9 @@ public:
|
||||
* fail_reason : string
|
||||
* }
|
||||
*/
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason); // non-200 errors only
|
||||
/*virtual*/ void httpFailure(void);
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return environmentApplyResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLEnvironmentApplyResponder"; }
|
||||
|
||||
@@ -163,15 +163,15 @@ void XMLRPCResponder::completed_headers(U32 status, std::string const& reason, A
|
||||
mTransferInfo = *info;
|
||||
}
|
||||
// Call base class implementation.
|
||||
LegacyPolledResponder::completed_headers(status, reason, info);
|
||||
ResponderWithCompleted::completed_headers(status, reason, info);
|
||||
}
|
||||
|
||||
void XMLRPCResponder::completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
void XMLRPCResponder::completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
if (mCode == CURLE_OK && !is_internal_http_error(status))
|
||||
if (mCode == CURLE_OK && !is_internal_http_error(mStatus))
|
||||
{
|
||||
mBufferSize = buffer->count(channels.in());
|
||||
if (200 <= status && status < 400)
|
||||
if (200 <= mStatus && mStatus < 400)
|
||||
{
|
||||
char* ptr = NULL;
|
||||
char* buf = NULL;
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
XMLRPC_VALUE mV;
|
||||
};
|
||||
|
||||
class XMLRPCResponder : public LLHTTPClient::LegacyPolledResponder {
|
||||
class XMLRPCResponder : public LLHTTPClient::ResponderWithCompleted {
|
||||
private:
|
||||
AITransferInfo mTransferInfo;
|
||||
S32 mBufferSize;
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
/*virtual*/ bool forbidReuse(void) const { return true; }
|
||||
/*virtual*/ void received_HTTP_header(void) { mReceivedHTTPHeader = true; LLHTTPClient::ResponderBase::received_HTTP_header(); }
|
||||
/*virtual*/ void completed_headers(U32 status, std::string const& reason, AITransferInfo* info);
|
||||
/*virtual*/ void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer);
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return XMLRPCResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "XMLRPCResponder"; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user