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:
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user