More curl fixes and changes.

* Moved LegacyPolledResponder::mCode to ResponderBase::mCode.
* Added a parameter to ResponderBase::finished (and pubError*) to set mCode.
* Renamed ResponderBase::decode_body to decode_llsd_body and added ResponderBase::decode_raw_body.
* Use LegacyPolledResponder::finished instead of LegacyPolledResponder::completed_headers
  to set remaining cached values.
* Fixed assertion in case of -DCWDEBUG and upload finish detection failure in case of HEAD
  method (mDebugIsGetMethod -> mDebugIsHeadOrGetMethod).
* Add XmlTreeInjector : support for LLXmlTree.
* Split BlockingResponder into BlockingLLSDResponder and BlockingRawResponder.
* Final blocking responders are now: BlockingLLSDPostResponder, BlockingLLSDGetResponder
  and BlockingRawGetResponder.
* Added LLHTTPClient::blockingGetRaw
* Got rid of hipporestrequest.* -- and fixed hippogridmanager.cpp to use
  LLHTTPClient::blockingGetRaw instead, and fixed llviewermessage.cpp to use
  AICurlInterface::ResponderWithCompleted and decode_raw_body instead of
  HippoRestHandlerRaw and LLHTTPClient::get4 instead of HippoRestRequest::get5.
This commit is contained in:
Aleric Inglewood
2012-10-28 17:38:25 +01:00
parent 2a88f7d7c4
commit 65e012c540
14 changed files with 290 additions and 131 deletions

View File

@@ -165,7 +165,6 @@
#include "hippogridmanager.h"
#include "hippolimits.h"
#include "hipporestrequest.h"
#include "hippofloaterxml.h"
#include "sgversion.h"
#include "m7wlinterface.h"
@@ -188,6 +187,8 @@
static const boost::regex NEWLINES("\\n{1}");
// NaCl End
extern AIHTTPTimeoutPolicy authHandler_timeout;
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
#include "llfloateravatarinfo.h"
extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp
@@ -3349,12 +3350,24 @@ void check_translate_chat(const std::string &mesg, LLChat &chat, const BOOL hist
// defined in llchatbar.cpp, but not declared in any header
void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel);
class AuthHandler : public HippoRestHandlerRaw
class AuthHandler : public AICurlInterface::ResponderWithCompleted
{
void result(const std::string &content)
protected:
/*virtual*/ void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
{
send_chat_from_viewer("AUTH:" + content, CHAT_TYPE_WHISPER, 427169570);
std::string content;
decode_raw_body(status, reason, channels, buffer, content);
if (status == 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;
}
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return authHandler_timeout; }
};
void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
@@ -3612,7 +3625,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
std::string authUrl = mesg.substr(8);
authUrl += (authUrl.find('?') != std::string::npos)? "&auth=": "?auth=";
authUrl += gAuthString;
HippoRestRequest::get5(authUrl, new AuthHandler());
LLHTTPClient::get4(authUrl, new AuthHandler);
return;
}
}