ResponderAdapter stuff
Renamed AICurlInterface::Responder to AICurlInterface::ResponderBase, but without the virtual 'event' methods. Derived from that: Responder and ReponderWithCompleted, where the first defines result = 0, ErrorWithContent and error, and the latter completedRaw and completed. Added HttpClient::IgnoreBody, derived from Responder and implementing 'result' doing nothing; HttpClient::Ignore is now derived from IgnoreBody and defines the still pure virtual getHTTPTimeoutPolicy. Added ResponderBase::decode_body, which is now the sole place where the code makes the decision wether some response data might be LLSD or not based on the http status result. Before it just tried to decode everything as LLSD, which seems a bit nonsense. ResponderWithCompleted::completed no longer does anything, since classes derived from ResponderWithCompleted are expected to override it, or never call it by overriding completedRaw. Entry point is now ResponderBase::finished = 0, instead of completedRaw, where ResponderWithCompleted implements finished by called completedRaw, but Responder doesn't: that directly calls result/errorWithContent/error. Or, for the hack ResponderAdapter, the entry points are pubResult/pubErrorWithContent. Those are now the ONLY public methods, so more confusion. mFinished is now set in all cases. As a result of all that, it is no longer possible to accidently pass a responder to ResponderAdapter that would break because it expects completed() and completedRaw() to be called. Added LLBufferArray::writeChannelTo. Fixed bug for BlockingResponder::body (returned reference to temporary). LLSDMessage::ResponderAdapter now allows a "timeoutpolicy" name to be passed (not doing so results in the default timings), so that the timeout policy of the used responder is retained. Fixed llfasttimerview.cpp to test LLSDSerialize::fromXML() to return a positive value instead of non-zero, because it may return -1 when the parsing fails (three places). Removed LLHTTPClient::Responder as base class from LLFloaterRegionDebugConsole completely: it isn't a responder! Several other responder classes were simplified a bit in order to compile again with the above changes.
This commit is contained in:
@@ -650,6 +650,20 @@ U8* LLBufferArray::readAfter(
|
||||
return rv;
|
||||
}
|
||||
|
||||
void LLBufferArray::writeChannelTo(std::ostream& ostr, S32 channel) const
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
LLMutexLock lock(mMutexp) ;
|
||||
const_segment_iterator_t const end = mSegments.end();
|
||||
for (const_segment_iterator_t it = mSegments.begin(); it != end; ++it)
|
||||
{
|
||||
if (it->isOnChannel(channel))
|
||||
{
|
||||
ostr.write((char*)it->data(), it->size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U8* LLBufferArray::seek(
|
||||
S32 channel,
|
||||
U8* start,
|
||||
|
||||
Reference in New Issue
Block a user