diff options
Diffstat (limited to 'indra/llmessage/tests/llcurl_stub.cpp')
-rwxr-xr-x | indra/llmessage/tests/llcurl_stub.cpp | 59 |
1 files changed, 40 insertions, 19 deletions
diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp index 9b298d0c04..b7fdf4f437 100755 --- a/indra/llmessage/tests/llcurl_stub.cpp +++ b/indra/llmessage/tests/llcurl_stub.cpp @@ -24,55 +24,76 @@ * $/LicenseInfo$ */ +#ifndef LL_CURL_STUB_CPP +#define LL_CURL_STUB_CPP + + #include "linden_common.h" #include "llcurl.h" +#include "llhttpconstants.cpp" LLCurl::Responder::Responder() { } -void LLCurl::Responder::completed(U32 status, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const &reason, - LLSD const& mContent) +void LLCurl::Responder::httpCompleted() { - if (isGoodStatus(status)) + if (isGoodStatus()) { - result(mContent); + httpSuccess(); } else { - errorWithContent(status, reason, mContent); + httpFailure(); } } -void LLCurl::Responder::completedHeader(unsigned, - std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, - LLSD const&) +void LLCurl::Responder::completedRaw(LLChannelDescriptors const&, + boost::shared_ptr<LLBufferArray> const&) { } -void LLCurl::Responder::completedRaw(unsigned, - std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, - LLChannelDescriptors const&, - boost::shared_ptr<LLBufferArray> const&) +void LLCurl::Responder::httpFailure() { } -void LLCurl::Responder::errorWithContent(unsigned, - std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, - LLSD const&) +LLCurl::Responder::~Responder () { } -LLCurl::Responder::~Responder () +void LLCurl::Responder::httpSuccess() +{ +} + +std::string LLCurl::Responder::dumpResponse() const +{ + return "dumpResponse()"; +} + +void LLCurl::Responder::successResult(const LLSD& content) { + setResult(HTTP_OK, "", content); + httpSuccess(); } -void LLCurl::Responder::error(unsigned, - std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) +void LLCurl::Responder::failureResult(S32 status, const std::string& reason, const LLSD& content) +{ + setResult(status, reason, content); + httpFailure(); +} + + +void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content) { + setResult(status, reason, content); + httpCompleted(); } -void LLCurl::Responder::result(LLSD const&) +void LLCurl::Responder::setResult(S32 status, const std::string& reason, const LLSD& content /* = LLSD() */) { + mStatus = status; + mReason = reason; + mContent = content; } +#endif |