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

@@ -59,10 +59,13 @@ public:
LLHandle<LLFloater> mParent;
virtual bool needsHeaders(void) const { return true; }
virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content)
virtual void completedHeaders(U32 status, std::string const& reason, AIHTTPHeaders const& headers)
{
std::string media_type = content["content-type"].asString();
std::string media_type;
bool content_type_found = headers.getValue("content-type", media_type);
llassert_always(content_type_found);
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
completeAny(status, mime_type);