Fixed showing TOS floater.

This creates a separate events interface structure
for CurlResponderBuffer (AICurlResponderBufferEvents)
for dealing with received HTTP headers.

The headers are passed to the Responder, but only
if the class derived from Responder implements
completedHeaders (otherwise it makes little sense
to even decode the headers).

Basically this is a reimplementation of the functionality
of the old LLHTTPClientURLAdaptor class.
This commit is contained in:
Aleric Inglewood
2012-09-18 23:59:09 +02:00
parent a032bd28ad
commit 1d5a63c180
13 changed files with 142 additions and 113 deletions

View File

@@ -37,52 +37,6 @@
F32 const HTTP_REQUEST_EXPIRY_SECS = 60.0f;
////////////////////////////////////////////////////////////////////////////
#if 0
class LLHTTPClientURLAdaptor : public LLURLRequestComplete
{
public:
LLHTTPClientURLAdaptor(LLCurl::ResponderPtr responder)
: LLURLRequestComplete(), mResponder(responder), mStatus(499),
mReason("LLURLRequest complete w/no status")
{
}
~LLHTTPClientURLAdaptor()
{
}
virtual void httpStatus(U32 status, const std::string& reason)
{
LLURLRequestComplete::httpStatus(status,reason);
mStatus = status;
mReason = reason;
}
virtual void complete(const LLChannelDescriptors& channels,
const buffer_ptr_t& buffer)
{
if (mResponder.get())
{
// Allow clients to parse headers before we attempt to parse
// the body and provide completed/result/error calls.
mResponder->completedHeader(mStatus, mReason, mHeaderOutput);
mResponder->completedRaw(mStatus, mReason, channels, buffer);
}
}
virtual void header(const std::string& header, const std::string& value)
{
mHeaderOutput[header] = value;
}
private:
LLCurl::ResponderPtr mResponder;
U32 mStatus;
std::string mReason;
LLSD mHeaderOutput;
};
#endif
class LLSDInjector : public Injector
{
public: