diff options
author | Josh Bell <josh@lindenlab.com> | 2007-03-14 23:03:50 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-03-14 23:03:50 +0000 |
commit | 00dbacb215da8d6b6739b4bcefebee552de89a9c (patch) | |
tree | e1256e1fa3b195a1128bb152a876729c7f9a163d /indra/llmessage | |
parent | cf405184285c25723249d5a023b28d9498cf0c3f (diff) |
svn merge svn+ssh://svn.lindenlab.com/svn/linden/release@59161 svn+ssh://svn.lindenlab.com/svn/linden/branches/release-candidate@59163 --> release
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llhttpclient.cpp | 26 | ||||
-rw-r--r-- | indra/llmessage/llhttpclient.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index d83308d082..f93a12b274 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -131,6 +131,27 @@ namespace const LLSD mSD; }; + + class RawInjector : public Injector + { + public: + RawInjector(const U8* data, S32 size) : mData(data), mSize(size) {} + virtual ~RawInjector() {} + + const char* contentType() { return "application/octet-stream"; } + + virtual EStatus process_impl(const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, bool& eos, LLSD& context, LLPumpIO* pump) + { + LLBufferStream ostream(channels, buffer.get()); + ostream.write((const char *)mData, mSize); // hopefully chars are always U8s + eos = true; + return STATUS_DONE; + } + + const U8* mData; + S32 mSize; + }; class FileInjector : public Injector { @@ -301,6 +322,11 @@ void LLHTTPClient::post(const std::string& url, const LLSD& body, ResponderPtr r request(url, LLURLRequest::HTTP_POST, new LLSDInjector(body), responder); } +void LLHTTPClient::post(const std::string& url, const U8* data, S32 size, ResponderPtr responder) +{ + request(url, LLURLRequest::HTTP_POST, new RawInjector(data, size), responder); +} + void LLHTTPClient::del(const std::string& url, ResponderPtr responder) { request(url, LLURLRequest::HTTP_DELETE, NULL, responder); diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index d64662e41d..a8afea312d 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -54,6 +54,7 @@ public: static void put(const std::string& url, const LLSD& body, ResponderPtr); ///< non-blocking static void post(const std::string& url, const LLSD& body, ResponderPtr); + static void post(const std::string& url, const U8* data, S32 size, ResponderPtr responder); static void postFile(const std::string& url, const std::string& filename, ResponderPtr); static void postFile(const std::string& url, const LLUUID& uuid, LLAssetType::EType asset_type, ResponderPtr responder); |